From jwcolby at colbyconsulting.com Thu Oct 1 14:47:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 15:47:08 -0400 Subject: [dba-VB] MySQL Message-ID: <4AC5073C.5050102@colbyconsulting.com> I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- John W. Colby www.ColbyConsulting.com From max.wanadoo at gmail.com Thu Oct 1 14:59:28 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 1 Oct 2009 20:59:28 +0100 Subject: [dba-VB] [AccessD] MySQL In-Reply-To: <4AC5073C.5050102@colbyconsulting.com> References: <4AC5073C.5050102@colbyconsulting.com> Message-ID: <4ac50a3a.0707d00a.659c.2f57@mx.google.com> No, but you might want to do it with Virtual Box (free from Sun). Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 01 October 2009 20:47 To: Access Developers discussion and problem solving; VBA Subject: [AccessD] MySQL I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- 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 Thu Oct 1 20:03:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 21:03:22 -0400 Subject: [dba-VB] SQL Server not locking up Message-ID: <4AC5515A.3070008@colbyconsulting.com> I am hesitantly declaring victory in the SQL Server war. I am going to award Nancy Lytle the award for the correct solution, with the proviso that she has to give it back if it turns out that the wily server misbehaves again. Since setting Max Degree of Parallelism to 3 I have not been locked out again. Understand that about this same time I also changed processor I/O affinity to only use the same three CPUs that I set CPU affinity for. And I have had so many problems with this, where it went away and then came back that I am very hesitant to declare victory but I did want to report back that the "locking up" issue hasn't recurred lately. Thanks go to everyone who volunteered suggestions. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 05:43:02 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 14:43:02 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: <002501ca4671$c8bfc420$5a3f4c60$@spb.ru> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From Gustav at cactus.dk Tue Oct 6 06:41:31 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Oct 2009 13:41:31 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Oct 6 07:37:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 Oct 2009 08:37:19 -0400 Subject: [dba-VB] Top 25 most dangerous programming errors Message-ID: <4ACB39FF.5030302@colbyconsulting.com> I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] Top 25 most dangerous programming errors In-Reply-To: <4ACB39FF.5030302@colbyconsulting.com> References: <4ACB39FF.5030302@colbyconsulting.com> Message-ID: <005e01ca46b3$6eccdb50$4c6691f0$@spb.ru> Hi John, Yes, that is a very useful site, thank you for sharing the link. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 06, 2009 4:37 PM To: Access Developers discussion and problem solving; VBA; Dba-Sqlserver Subject: [dba-VB] Top 25 most dangerous programming errors I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 13:45:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 19:45:00 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Message-ID: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 6 15:35:40 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 00:35:40 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Message-ID: <007701ca46c4$92e02d60$b8a08820$@spb.ru> Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 15:39:41 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 21:39:41 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <007701ca46c4$92e02d60$b8a08820$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> <007701ca46c4$92e02d60$b8a08820$@spb.ru> Message-ID: <4acbab22.0a1ad00a.7ab2.40ff@mx.google.com> I just saw the headlines on that link I sent you. You will have to read through what is on offer. They do all sorts of things on all sorts of platforms for all sorts of systems. It is really just a pick-and-mix for whatever you need. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 21:36 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Oct 7 07:53:48 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 14:53:48 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Wed Oct 7 08:31:08 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 17:31:08 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <009501ca4752$6f1073c0$4d315b40$@spb.ru> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 7 08:46:29 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 15:46:29 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil I believe they offer all of the three common scenarios: 1. Hosted in a shared environment (virtual) where you cannot install anything special 2. Hosting of a dedicated server provided by you or your client, installed as you like 3. Hosting of a dedicated server supplied by Verinet for your exclusive use, remotely installed by you I'll ask when my contact replies about your options. And yes, that is the exchange rate. /gustav >>> shamil at smsconsulting.spb.ru 07-10-2009 15:31 >>> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri Oct 9 11:24:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Oct 2009 12:24:52 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class Message-ID: <4ACF63D4.7090001@colbyconsulting.com> I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Oct 9 17:00:05 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 02:00:05 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4ACF63D4.7090001@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> Message-ID: <003601ca492b$dd700d50$985027f0$@spb.ru> Hi John, You can put your initialization code into your form constructor or Form_Load event processing method. BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP when programming on C# - and you'll feel a great relieve. Guaranteed/tested/proven by many developers. There are .NET natural naming conventions recommended by MS. Try to find and use them. Here is one source: http://www.irritatedvowel.com/Programming/Standards.aspx Here is a VS plug-in to help you get accustomed to the new naming conventions: http://www.codeplex.com/StyleCopForReSharper Although I haven't used it yet. --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 09, 2009 8:25 PM To: VBA Subject: [dba-VB] Error when passing controls to the constructor of a class I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Sat Oct 10 08:35:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 10 Oct 2009 09:35:01 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <003601ca492b$dd700d50$985027f0$@spb.ru> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> Message-ID: <4AD08D85.5030308@colbyconsulting.com> Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > From shamil at smsconsulting.spb.ru Sat Oct 10 11:18:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 20:18:53 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4AD08D85.5030308@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> <4AD08D85.5030308@colbyconsulting.com> Message-ID: <000601ca49c5$5dfbabc0$19f30340$@spb.ru> Hi John -- Yes, it works well for me - programming without Hungarian notation in .NET development - they say Hungarian is not needed because you can always use Intellisense to see the type of variables etc. I still use Hungarian notation sometimes in control names, and always when naming MS SQL views, SPs, UDFs, triggers... As for inconsistency in MS internal code - I suppose they can't quit Hungarian notation habits overnight - but they are moving in the new direction for sure... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, October 10, 2009 5:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Error when passing controls to the constructor of a class Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4495 (20091010) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Mon Oct 12 21:35:07 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 12 Oct 2009 22:35:07 -0400 Subject: [dba-VB] C# serialization Message-ID: <4AD3E75B.2070006@colbyconsulting.com> I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Oct 12 22:29:00 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 13 Oct 2009 14:29:00 +1100 Subject: [dba-VB] C# serialization References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015824EA@ddi-01.DDI.local> Hi John, I did this a few years ago and the project got canned so beware :-). It only works with a single class at a time IIRC. Maybe LINQ to XML might be the way to go for building nested related objects? Just struggling through some of this myself, but I'm working from existing XML data. Look at creating XML trees. http://msdn.microsoft.com/en-us/library/bb387068.aspx good luck Michael M using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.IO; using System.Xml.Serialization; /// /// Serializes and deserializes Layout objects /// public class Serializer { public Serializer( ) { } /// /// Serializes the Layout object /// /// /// public void SerializeNow( string filePath, T source, SerializationFormat format ) { if ( source == null ) throw new ArgumentNullException( "source", "Invalid object to serialize" ); if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format ) { case SerializationFormat.Xml: // Insert code to set properties and fields of the object. XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); // To write to a file, create a StreamWriter object. using ( StreamWriter myWriter = new StreamWriter( "PedalMap.xml" ) ) { mySerializer.Serialize( myWriter, source ); myWriter.Close( ); } break; case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.OpenOrCreate, FileAccess.Write ) ) { BinaryFormatter b = new BinaryFormatter( ); b.Serialize( fs, source ); } break; } } /// /// Deserializes the Layout object /// /// /// public T DeSerializeNow( string filePath, SerializationFormat format ) { if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format) { case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.Open, FileAccess.Read ) ) { BinaryFormatter b = new BinaryFormatter( ); try { return ( T ) b.Deserialize( fs ); } catch { return default( T ); } } case SerializationFormat.Xml: XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); using ( StreamReader myReader = new StreamReader( filePath ) ) return ( T ) mySerializer.Deserialize( myReader ); } return default( T ); } } The object to serialize, add the Serializable( ) attribute to the class. [Serializable( )] //Set this attribute to all the classes that want to serialize public class PedalMap { public PedalMap( ) { } //Add your properties here } You call it like so... Serializer s = new Serializer( ); s.SerializeNow( Application.ExecutablePath, _pmap, SerializationFormat.Xml ); -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 13 October 2009 1:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 13 09:54:36 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 07:54:36 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD3E75B.2070006@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: John, I'm not sure I understand what you're doing. Do these classes inherit typed datasets? If so, the parent class can easily return a child class that already contains a typed dataset of child records. You don't actually need collections for that. In that case, grade wouldn't need to be a class (although it could be, I just don't see any need). The Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, October 12, 2009 7:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Oct 13 10:37:59 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:37:59 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <4AD49ED7.5060300@colbyconsulting.com> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From cfoust at infostatsystems.com Tue Oct 13 10:39:40 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 08:39:40 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD49ED7.5060300@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: You can build a typed dataset on an xml file John. Doesn't require a database. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:38 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child > class that already contains a typed dataset of child records. You > don't actually need collections for that. In that case, grade > wouldn't need to be a class (although it could be, I just don't see > any need). The > > Charlotte Foust From Gustav at cactus.dk Tue Oct 13 10:57:22 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 17:57:22 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Sounds like a quite normal database app to me ... If so, all the typed dataset stuff is ready at your hands. To persist (to an XML file without the overhead you claim about) use method WriteXml. To read it at load, use method ReadXml. Can't be simpler. Of course, I can see an educational purpose by handcrafting a kind of database, but ... /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 10:59:49 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:59:49 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: <4AD4A3F5.5030509@colbyconsulting.com> That's nice Charlotte, but I assume that I would have to completely rewrite some level of how I do things. I would certainly welcome knowing how to do that but I don't want to do so at this moment. If this has anything to do with ADO and all of that stuff, I will be getting into that later. A year or so ago I used something similar to what I am doing now and just used serialization to write it out to a stream and later read it back in. I know from experience that once you are up to speed on the syntax of a language, it is easy to forget what a PITA all the nitpicking details are. I am still dealing with [] instead of () for the collections, explicit data type conversions and all the rest of the stuff that you don't even remember learning. "Building a typed dataset" of any kind is not where I am right now, never mind "on an XML file". Have patience Master. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > You can build a typed dataset on an xml file John. Doesn't require a > database. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 8:38 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply > input a list of grades. > There are three types of grades, each with a different weight (Tests - > 40% of grade, Labs - 50% of grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating > a total count of each grade type, sum of each type, average of each type > and weighted average of each type, and then the same calculations for > the totals. > > In order not to be bored to death, and with the approval of the > instructor, I expanded the assignment to include using classes and > collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) > which contains a generic collection into which the instances of clsGrade > are inserted. This collection is strongly typed so that it can only > accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in > clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or > "DL"). In the main form there is a combo with three grade type strings > ("Test", "Lab" and "DL") which when selected is passed in to > clsCalculator which indexes into the collection to access the correct > instance of clsGrades. Adding new grades, deleting grades and updating > existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection > holding three instances of... > clsGrades - contains a strongly typed generic collection holding > multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, > average and weighted average all of the grades contained within. > > clsCalculator requests the various computed values from the three > instances of clsGrades and performs the calculations to create an > overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), > Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, > then read it back in again. > Persist the grades to disk. I have no requirement to persist the data > to disk, I simply want to do so. > > Please please please do not suggest a "better way" for doing the > assignment, it is all written and functions exactly as you would expect > it to work. You may of course enlighten me on different options, but I > will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I > can persist it great, if not that's OK too. I have learned a lot and > thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a > "next semester" thing so I am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit > >> typed datasets? If so, the parent class can easily return a child >> class that already contains a typed dataset of child records. You >> don't actually need collections for that. In that case, grade >> wouldn't need to be a class (although it could be, I just don't see >> any need). The >> >> Charlotte Foust > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 13 11:13:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:13:13 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4A719.9090900@colbyconsulting.com> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Tue Oct 13 11:34:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 18:34:38 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 11:43:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:43:39 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4AE3B.1010205@colbyconsulting.com> I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at > typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at > that level. > > I am quite sure that in a year I will be throwing out typed datasets with the best of them but right > now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav From cfoust at infostatsystems.com Tue Oct 13 12:10:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 10:10:19 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4AE3B.1010205@colbyconsulting.com> References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: John, Typed datasets ARE serialized. That's the point. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 9:44 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to > LEARN C#. You do not start at typed data sets, you start with "this > is a variable" and "this is a for loop". I am very much at that level. > > I am quite sure that in a year I will be throwing out typed datasets > with the best of them but right now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Oct 13 13:19:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 14:19:30 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: <4AD4C4B2.9020600@colbyconsulting.com> Charlotte, No, the point is that datasets are over my head at this point in the journey. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > Typed datasets ARE serialized. That's the point. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 9:44 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > I am under the impression that you can write ANY repeating sequence such > as these grade classes to XML and read them back rather easily, using > serialization. However the only examples I am seeing are from back in > 100, 2002, 2004. A lot has happened since then, so I figured to get > modern examples of the same thing. Google is not being my friend ATM. > > As I said, I did this in VB, but cannot find my old code. > > I will certainly end up doing the database thing, but I want to get the > basic C# syntax down before I go there. I am still thumbing through my > book for the simplest little things. > > John W. Colby > www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 13 14:26:44 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 13 Oct 2009 23:26:44 +0400 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4A719.9090900@colbyconsulting.com> References: <4AD4A719.9090900@colbyconsulting.com> Message-ID: <003601ca4c3b$1a8cb190$4fa614b0$@spb.ru> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (part 1_ Message-ID: <004701ca4c41$9a7451a0$cf5cf4e0$@spb.ru> Hi John, The below approach and XmlArray attribute can be used for your sample/test case - the below posting didn't get dba-VB moderation on 20-SEP-09 : << Your mail to 'dba-VB' with the subject JSON and XML in memory serialization sample code Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 39406 bytes with a limit of 20 KB >> So I'm posting it here split into three parts: From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Sunday, September 20, 2009 6:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: JSON and XML in memory serialization sample code Hi All, Related to recent John post here (see P.S.) is a sample code of JSON and XML in memory serialization - how I do it usually. My question is do you know a way to implement XML in memory serialization using less code lines? I do use this XML code serialization for quite some time and I could have some new features, which could allow to simplify this code: Thank you. --Shamil P.S. Code sample - watch line wraps! - this code was nicely formatted here but when it will go through Internet it will get lines wrapped but anyway it should work - just edit comment lines and add references to System.Web and System.Web.Extensions assemblies: Continued in the next posting: From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 2) Message-ID: <004201ca4c41$992b56e0$cb8204a0$@spb.ru> Continued. using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; using System.Web.Script.Serialization; namespace ConsoleApplication1 { [XmlType("phoneBookEntry")] public class PhoneBookEntry { [XmlAttribute("firstName")] public string FirstName {get;set;} [XmlAttribute("lastName")] public string LastName { get; set; } [XmlAttribute("phoneName")] public string Phone { get; set; } } class Program { static void Main(string[] args) { PhoneBookEntry entry = new PhoneBookEntry(); entry.FirstName = "Peter"; entry.LastName = "Brown"; entry.Phone = "+7-921-1234567"; JavaScriptSerializer js = new JavaScriptSerializer(); string jsEntry = js.Serialize(entry); Console.WriteLine("1. JSON string\n{0}", jsEntry); PhoneBookEntry[] entries = { entry, entry, entry }; string jsEntries = js.Serialize(entries); Console.WriteLine("1. JSON array\n{0}", jsEntries); string xmlEntry = InMemoryObjectsSerializer.Serialize(entry); Console.WriteLine("1. XML string\n{0}", xmlEntry); string xmlEntries = InMemoryObjectsSerializer.Serialize(entries); Console.WriteLine("1. XML array\n{0}", xmlEntries); } } To be continued in part 3. From shamil at smsconsulting.spb.ru Tue Oct 13 15:17:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:17:52 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.2) Message-ID: <004c01ca4c42$3f63fb70$be2bf250$@spb.ru> Continued (from 3.1). /// /// In memory object data serialization /// public class InMemoryObjectsSerializer { /// /// Cconverts a custom object instance to XML string /// /// Object that is to be serialized to XML /// XML string in UTF8 format public static String Serialize(Object pObject) { String XmlizedString = null; MemoryStream memoryStream = new MemoryStream(); XmlSerializer xs = new XmlSerializer(typeof(T)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); xs.Serialize(xmlTextWriter, pObject); memoryStream = (MemoryStream)xmlTextWriter.BaseStream; XmlizedString = StringToBytes.UTF8ByteArrayToString(memoryStream.ToArray()); return XmlizedString; } /// /// Reconstruct an object instance from XML string /// /// Xml string to be used for object instance deserialization /// public static Object Deserialize(String pXmlizedString) { XmlSerializer xs = new XmlSerializer(typeof(T)); MemoryStream memoryStream = new MemoryStream(StringToBytes.StringToUTF8ByteArray(pXmlizedString)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); return xs.Deserialize(memoryStream); } } } From shamil at smsconsulting.spb.ru Tue Oct 13 15:20:31 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:20:31 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.1) Message-ID: <005601ca4c42$9dfc7180$d9f55480$@spb.ru> From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Wednesday, October 14, 2009 12:13 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: FW: JSON and XML in memory serialization sample code (Part 3) Continued from Part 2. /// /// Converts strings to byte arrays and vice versa /// public class StringToBytes { /// /// Converts a Byte Array of Unicode values (UTF-8 encoded) to a complete String. /// /// Unicode Byte Array to be converted to String /// String converted from Unicode Byte Array public static String UTF8ByteArrayToString(Byte[] characters) { UTF8Encoding encoding = new UTF8Encoding(); String constructedString = encoding.GetString(characters); return (constructedString); } /// /// Converts the String to UTF8 Byte array and is used in De serialization /// /// /// public static Byte[] StringToUTF8ByteArray(String pXmlString) { UTF8Encoding encoding = new UTF8Encoding(); Byte[] byteArray = encoding.GetBytes(pXmlString); return byteArray; } } To be continued in Part 3.2.. From Gustav at cactus.dk Tue Oct 13 16:25:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 23:25:35 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav From shamil at smsconsulting.spb.ru Tue Oct 13 17:28:47 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 02:28:47 +0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <005b01ca4c54$892d1f40$9b875dc0$@spb.ru> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 14, 2009 1:26 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# serialization Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 14 02:52:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 09:52:03 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks, I understand that now. /gustav >>> shamil at smsconsulting.spb.ru 14-10-2009 00:28 >>> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil From jwcolby at colbyconsulting.com Wed Oct 14 12:37:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 13:37:15 -0400 Subject: [dba-VB] Merge / Purge Message-ID: <4AD60C4B.2030706@colbyconsulting.com> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Oct 14 12:52:41 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 19:52:41 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John I would skip the update and delete parts as these are very slow. Instead, read/loop through the sorted table and append the single records to a new table. Thus: 1. Sort by name and "recenty" (what is the word for this, the most recent?) 2. Loop while collecting data for each name 3. For each name, append the collected and arranged data to the new (cleaned) table 4. Leave the old table as a backup I haven't worked with that many records so I cannot tell which coding method will turn out fastest. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Oct 14 13:05:50 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:05:50 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD612FE.5010107@colbyconsulting.com> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From Gustav at cactus.dk Wed Oct 14 13:19:23 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 20:19:23 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. From jwcolby at colbyconsulting.com Wed Oct 14 13:31:14 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:31:14 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD618F2.3080407@colbyconsulting.com> Further to this. I have a hash field which contains an SH1 hash for FName + LName + Addr + Zip5 + Zip4. These hash strings are absolutely unique (tested and confirmed) so what I am doing is pulling a view grouped by hash key where Count(PK) > 1. This gives me the data set of all hash keys of multiple ("dupes") records. In fact the hash key (and in fact all name / address fields) are out in a separate table related 1 to 1 with the fact table which I am "merging". Thus the hash would really pull a set of PKIDs which would be used to pull all of the fact records for the person that the hash key belongs to. Once those fact records are sitting in memory I would thing the update code would zip pretty well. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From jwcolby at colbyconsulting.com Wed Oct 14 13:39:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:39:10 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61ACE.6030707@colbyconsulting.com> You are right of course but I am thinking the update would just fly. There are about 550 fields in the fact table. Thus I would be comparing / updating 550 fields, sequentially, between Rec1 and Rec2. Then Rec2 / Rec3, Rec1 / Rec4 etc until all fact records for a given hash key (person) are finished. The "facts" can be anything from strings of 20-30 bytes down to a simple "Y". The vast majority of fields contain "Y" or nothing. A small minority contain codes ('A' - 'T') for example. And a very small number contain somewhat longer strings. This is not a transaction database so there will be no locking contentions etc. Just me and my update program whistling away. I will be working on a copy of the main table of course. Maybe writing modified (Record1) to one table and deleted (Records 2-N) to another table. At the end do the deletes / inserts. It probably will pay to copy all of the duplicate fact records out to a temp table and work on that as the source table. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 14 13:41:03 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:41:03 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61B3F.8000409@colbyconsulting.com> This is exactly the kind of stuff that I am taking my class for. C# is so much more faster / powerful than VBA in this kind of processing. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Wed Oct 14 14:51:07 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 15 Oct 2009 05:51:07 +1000 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD61B3F.8000409@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com> Message-ID: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> John, > >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > >> position, NOT date (I don't have date info). SQL Server doesn't have a concept of chronological record position. Unless there is atimestamp or incrementing field, there is no way to know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. Do use have an incrementing key field? Stuart McLachlan From jwcolby at colbyconsulting.com Wed Oct 14 15:19:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 16:19:54 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> References: , <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> Message-ID: <4AD6326A.4080708@colbyconsulting.com> Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. Unless there is > atimestamp or incrementing field, there is no way to know which is the most recent entry or > to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From cfoust at infostatsystems.com Wed Oct 14 16:20:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 14 Oct 2009 14:20:42 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6326A.4080708@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: Unless they have data in the same fields. Then what happens? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 14, 2009 1:20 PM To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Merge / Purge Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. >>>> "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent >>>> data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. > Unless there is atimestamp or incrementing field, there is no way to > know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 14 22:18:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 23:18:19 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: <4AD6947B.8090807@colbyconsulting.com> Charlotte, > Unless they have data in the same fields. Then what happens? Well, so what? Either overwrite or don't. Remember it is impossible to tell which is correct. They can't BOTH be correct. Flip a coin and do something, it literally doesn't matter what. John Colby Owns_A_Dog = 'Y' John Colby Owns_A_Dog = 'N' Which one is true? We have no way to say one record is more recent so flip a coin and merge the data. In fact in most cases (90% of all the fields) the data is "Y" or nothing. These records are the result of people taking polls. So in 90% of the cases, the person will answer "Y" or they have no answer because they weren't asked that question in that poll. The objective here is to get a ton of individual poll responses merged into a single record. I did a count earlier today and one person is in the database 36 times, 26 times, 17, 16, two 14s, four 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million total records). So when I try to ask the question "income bracket in (A-T)" and ("Owns a dog" OR "owns a cat") AND "mail order buyer", I end up with cases where "Owns a dog" was answered in one record and "mail order buyer" was answered in another record. So the AND fails whereas in fact the person answered affirmatively to both questions, just not in the same record. This is nuts. I need to merge things down so that there is a single record for a single person. ALL ANSWERS need to be in one record. If there are conflicting records, flip a coin, pick one answer. Now before you go off on normalization and a single column fact table, just remember that I have 50 million records X 550 columns. A single column fact table would end up with 25 Tera records and I don't have a supercomputer. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Unless they have data in the same fields. Then what happens? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 14, 2009 1:20 PM > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > related programming issues. > Subject: Re: [dba-VB] Merge / Purge > > Stuart, > > Yes there is a PKID. The thing is, every record is equal so it simply > doesn't matter in which order the records are pulled. Any of the > duplicates can be treated as the first record to be updated by whatever > is found in the subsequent records. > > It literally doesn't matter which record is encountered first. > > John W. Colby > www.ColbyConsulting.com From dbdoug at gmail.com Wed Oct 14 22:30:51 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 14 Oct 2009 20:30:51 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6947B.8090807@colbyconsulting.com> References: <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> <4AD6947B.8090807@colbyconsulting.com> Message-ID: <4dd71a0c0910142030vb19034fh7e316528476dcbca@mail.gmail.com> On Wed, Oct 14, 2009 at 8:18 PM, jwcolby wrote: > Charlotte, > > > Unless they have data in the same fields. Then what happens? > > Well, so what? Either overwrite or don't. Remember it is impossible to > tell which is correct. > They can't BOTH be correct. Flip a coin and do something, it literally > doesn't matter what. > > John Colby Owns_A_Dog = 'Y' > John Colby Owns_A_Dog = 'N' > > Which one is true? We have no way to say one record is more recent so flip > a coin and merge the data. > > In fact in most cases (90% of all the fields) the data is "Y" or nothing. > These records are the > result of people taking polls. So in 90% of the cases, the person will > answer "Y" or they have no > answer because they weren't asked that question in that poll. > > The objective here is to get a ton of individual poll responses merged into > a single record. I did > a count earlier today and one person is in the database 36 times, 26 times, > 17, 16, two 14s, four > 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million > total records). > > So when I try to ask the question "income bracket in (A-T)" and ("Owns a > dog" OR "owns a cat") AND > "mail order buyer", I end up with cases where "Owns a dog" was answered in > one record and "mail > order buyer" was answered in another record. So the AND fails whereas in > fact the person answered > affirmatively to both questions, just not in the same record. This is > nuts. I need to merge things > down so that there is a single record for a single person. ALL ANSWERS > need to be in one record. > If there are conflicting records, flip a coin, pick one answer. > > Now before you go off on normalization and a single column fact table, just > remember that I have 50 > million records X 550 columns. A single column fact table would end up > with 25 Tera records and I > don't have a supercomputer. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: > > Unless they have data in the same fields. Then what happens? > > > > Charlotte Foust > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Wednesday, October 14, 2009 1:20 PM > > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > > related programming issues. > > Subject: Re: [dba-VB] Merge / Purge > > > > Stuart, > > > > Yes there is a PKID. The thing is, every record is equal so it simply > > doesn't matter in which order the records are pulled. Any of the > > duplicates can be treated as the first record to be updated by whatever > > is found in the subsequent records. > > > > It literally doesn't matter which record is encountered first. > > > > John W. Colby > > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dwaters at usinternet.com Thu Oct 15 17:56:00 2009 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 15 Oct 2009 17:56:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Message-ID: I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan From shamil at smsconsulting.spb.ru Fri Oct 16 06:24:20 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 15:24:20 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 07:16:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 08:16:46 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <4AD8642E.6020103@colbyconsulting.com> It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Oct 16 07:26:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 16:26:53 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD8642E.6020103@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> Message-ID: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Hi John, Thank you for your remark. 1 form/report times 2.5 works rather well provided existing functionality is preserved. For new projects 1 (final) form/report times 4 is a better ballpark figure. This is software development industry wide experience. It doesn't matter what framework etc. is used. BTW, your framework could be relatively easy ported to .NET, I suppose. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 4:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 08:16:51 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 09:16:51 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Message-ID: <4AD87243.8080200@colbyconsulting.com> Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Thank you for your remark. > > 1 form/report times 2.5 works rather well provided existing functionality is > preserved. For new projects 1 (final) form/report times 4 is a better > ballpark figure. This is software development industry wide experience. It > doesn't matter what framework etc. is used. BTW, your framework could be > relatively easy ported to .NET, I suppose. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 4:17 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? > > It also depends on many other things. For example if you were to convert > one of my projects you > would be facing my framework and tons of classes and modules. That stuff > might just convert but > maybe not. How about DAO specific code in modules? I reference databases, > recordsets, fields, even > properties of fields, I use dynamic queries modifying TDFs in code, I build > dynamic SQL and execute > it with the database object. > > I have error logging, login logging, usage of forms logging. I control > access to forms and controls > on forms based on user/group/usergroup security, manipulating Enabled, > Locked and Visible properties > based on the user rights. I control subform loading based on whether a ton > of controls two forms up > have valid data in them, allowing supervisors to override but not normal > users. > > Also what BE are you going to? SQL Server? Staying with an MDB? How about > VBA functions embedded > in queries? Are you moving from DAO bound to ADO unbound? Are you setting > a DAO recordset to the > form's recordset clone and then doing stuff behind the scenes? I am now > using pass through queries > to pull data from SQL Server views. > > How about import / export of data? My applications strip files off of email > and download from FTP > sites, and even watch directories, then convert to / from CSV and fixed > width files, importing and > exporting to tables. I have table driven code which builds fixed width > reports with header and > footer information based on mainframe specs provided by banks and insurance > companies. > > Your formula would probably work if the original was written by a power user > (or summer intern in > the case of NorthWind). I would be VERY hesitant to make a firm quote on > such a rule of thumb. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hello Dan, >> >> I'd count it as one form/report => 1 day => times 2.5 = that would include >> all project costs not only development. >> But if you do not plan to change any functionality then it can be done >> quicker - here is a real life conversion case's stats online: >> >> http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 >> >> The estimations were between 45 and 165 hours - just for conversion >> development work - average estimation was exactly around the final figure: >> ~65 hours for 35 forms/reports (with subforms/sureports). Final result is >> not "industry strong" - it would need another 60 hours to make it > "industry >> strong", even more time would be needed to write docs and online help if >> needed etc. - all in all it will be 1 day for 1 form/report for such a >> simple application... >> >> Of course it also depends on how experienced your developers are, what >> architecture your converted system is planned to have etc. >> >> Thank you. >> >> -- >> Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 08:57:25 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 17:57:25 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD87243.8080200@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> <4AD87243.8080200@colbyconsulting.com> Message-ID: <006f01ca4e68$989fdf60$c9df9e20$@spb.ru> Hi John, You can use DAO in C#/VB.NET, although you can't bind forms/reports (MSReportViewerControl) to DAO recordsets therefore yes, DAO has to be removed I suppose. But if you're so "sticky" (:) kidding) to DAO you can model/simulate it via ADO.NET. It shouldn't be a big issue to create wrapper classes simulating DAO (the DAO features you use - this subset is rather limited I expect) but using ADO.NET, and then that wrapper classes can have properties, which can be bound to e.g. WinForms... WithEvents is everywhere in .NET - you'll feel OK with that. WinForms events do differ from MS Access forms' ones but you can find good equivalents I suppose. All in all I still suppose that conversion of your framework to .NET wouldn't be a complicated task - I'd propose to do that conversion not literally but conceptually - preserving your framework's principles/concepts/architecture but substituting (and not trying to simulate) technologies as DAO with the .NET native ones... I must also note that nowadays (in the near future with release of .NET Framework 4.0/VS 2010) we will get so powerful framework from MS that developing custom frameworks would become an overkill... <<< Microsoft kindly gave us the DAO object model and I know it (and program it) very well. >>> Well, DAO forced so many developers to think too straightforward navigational way, and it (DAO) was developed the time when it was already clear for many years that a one working with relational databases should better use "set thinking" approach - it was a real PITA to use DAO all that years, how many "spaghetti" code was developed because of that... In .NET as I noted already in another thread here for enterprise level apps and small businesses custom apps when programming against backend DBs are that MS Access or MS SQL ones - you usually need just a few - I'd count less than ten classes and methods of ADO.NET. Yes, I understand in your framework you make many run-time dynamic SQL-scripts generation - you will not need that in .NET - but if you'll need you can use NHibernate for dynamic objects/SQL or many code generation tools for static objects/SQL generation etc. - and I'd rely solely on ADO.NET Entity Framework starting .NET Framework v.4.0 ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 5:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com <<< snipped >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From dwaters at usinternet.com Fri Oct 16 09:09:59 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 09:09:59 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Oct 16 11:00:26 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 09:00:26 -0700 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: Just be aware that conversion tools do splendidly if what they're converting is fairly straight-forward objects and code. They fall in a heap over complex subforms and subreports. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 7:10 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 16 12:56:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 21:56:52 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 13:27:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 14:27:05 -0400 Subject: [dba-VB] Threads and stuff Message-ID: <4AD8BAF9.4070304@colbyconsulting.com> I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Oct 16 15:00:20 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 13:00:20 -0700 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: Are you declaring the properties shared? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 11:27 AM To: VBA Subject: [dba-VB] Threads and stuff I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 16 15:06:16 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 15:06:16 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 16 15:33:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 16:33:05 -0400 Subject: [dba-VB] Threads and stuff In-Reply-To: References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <4AD8D881.8050103@colbyconsulting.com> Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 15:40:12 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Oct 2009 00:40:12 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: <008a01ca4ea0$ddae6c10$990b4430$@spb.ru> Hi Dan, OK, that sounds good - a good candidate application for automated conversion I mean :) 50KB of code isn't that much to clean-up after automated conversion but it's important to know what this code does? For example, once in the very beginning of my .NET development practice I have got converted advanced MS Excel VB6 COM add-in with about 10,000-15,000(?) code lines into VB.NET COM add-in - conversion of VB6 code into VB.NET is a built-in feature of Visual Studio but after that conversion I have spent about three days to make the converted code up & running, and I have got all that add-in functionality working OK. That add-in code didn't use database and if your code is like that - i.e. it is mainly utility/business layer functionality without that much db communication and without a lot of built-in SQL then clean-up of 50KB of code lines after automatic conversion could be done in max. 15 days. You can try to use the tools you mentioned with Northwind db - and I (and maybe somebody else also here) can have a look on the results of automatic conversion, and then we can tell more clearly how good this automatic conversion is. I'd note that the companies who sell such conversion tools do usually have rather limited evaluation versions - if such evaluation version will not be able to process NorthWind sample app (do they have it already processed as sa ample?) maybe you can contact them directly and ask to run the full version against Northwind and send you the converted result for evaluation. It's not an issue IMO for evaluation that converted app will have MS Access BE because the main part of work of your app conversion is currently expected to be forms/reports + code conversion... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Saturday, October 17, 2009 12:06 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From michael at ddisolutions.com.au Sun Oct 18 17:47:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 19 Oct 2009 09:47:17 +1100 Subject: [dba-VB] Threads and stuff References: <4AD8BAF9.4070304@colbyconsulting.com> <4AD8D881.8050103@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01582518@ddi-01.DDI.local> Hi John, I havn't delved deeply into the threading model in .net. I have used the background worker object from time to time though. The way that works is using events to pass data to and from your threaded class. It's always worked well for my modest needs. That said, will the 'volatile' keyword help you? Cheers Michael M Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Oct 19 00:44:23 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Oct 2009 09:44:23 +0400 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <00d601ca507f$38e682e0$aab388a0$@spb.ru> <<< Anyway, because the class method that the thread runs has to be static >>> Hi John, Threads can run on instance methods - here is just a quick sample - no static methods used at all except console app's entry method: using System; using System.Threading; namespace ConsoleApplication1 { public class ThreadRunner { private int _threadNum; public ThreadRunner(int threadNum) { _threadNum = threadNum; } public void Run() { Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} started, Id = {2}", DateTime.Now, _threadNum, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(1100 - _threadNum*100 ); Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} finished.", DateTime.Now, _threadNum); } } public class ThreadManager { public void StartThreads() { for (int i = 1; i<=10; i++) { Thread th = new Thread(RunThread); th.Start(new ThreadRunner(i)); } } public void RunThread(object threadRunner) { ThreadRunner tr = (ThreadRunner)threadRunner; tr.Run(); } } class Program { static void Main(string[] args) { (new ThreadManager()).StartThreads(); } } } Here is output this sample produces: 09:41.53.519: Thread#3 started, Id = 5 09:41.53.519: Thread#1 started, Id = 3 09:41.53.522: Thread#4 started, Id = 6 09:41.53.524: Thread#5 started, Id = 7 09:41.53.520: Thread#2 started, Id = 4 09:41.53.524: Thread#6 started, Id = 8 09:41.53.524: Thread#7 started, Id = 9 09:41.53.524: Thread#8 started, Id = 10 09:41.53.524: Thread#9 started, Id = 11 09:41.53.524: Thread#10 started, Id = 12 09:41.53.625: Thread#10 finished. 09:41.53.724: Thread#9 finished. 09:41.53.824: Thread#8 finished. 09:41.53.924: Thread#7 finished. 09:41.54.024: Thread#6 finished. 09:41.54.124: Thread#5 finished. 09:41.54.223: Thread#4 finished. 09:41.54.323: Thread#3 finished. 09:41.54.424: Thread#2 finished. 09:41.54.523: Thread#1 finished. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 10:27 PM To: VBA Subject: [dba-VB] Threads and stuff .... Anyway, because the class method that the thread runs has to be static ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4520 (20091018) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Oct 19 05:13:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 19 Oct 2009 12:13:46 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil My contact has been on vacation. He'll forward me some info later today which I will forward to you off-line. He confirms that hosting, indeed traffic, may be quite expensive in Russia. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From raibeart at gmail.com Mon Oct 19 20:31:00 2009 From: raibeart at gmail.com (Robert Stewart) Date: Mon, 19 Oct 2009 20:31:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <4add12d6.0ac0100a.3a77.520b@mx.google.com> From what I am reading, Access Whiz Options: First Option Price Bundle Price A- Access to VB .NET (Web Application): ANETVB $169.00 $60.00 B- Access to VB .NET (Windows Application): ANETVB8 $169.00 $60.00 C- Access to VB6 (Windows Application): AccessToVB6 $94.00 $40.00 D- Access to C# (Web Application) ANETVC $169.00 $60.00 E- Access to Crystal Reports 8 or later: AccessToCR $169.00 $60.00 F- Access Form Controls to VB .NET: ANETVBF $45.00 $25.00 G- Access Form Controls to C# .NET: ANETVCF $45.00 $25.00 H- Access to C# (Windows Application): ANETVC7 $169.00 $60.00 Looks like it would cost me: D - $169 E - $ 60 G - $ 25 ______ $254 To be able to do a complete conversion, plus the cost of Crystal. On the second one, the link is broken to the 2003 databases, and it only converts to VB6. I think they are a bit too far behind the times to be very useful. I will take a look at the first one and let the list know back what I think about it. I think my code is pretty good and standard. So, it should not be that difficult for the program to convert it to C#. I have a project about double the size of yours to convert to ASP.net. So a tool like this might be very useful. In looking at the download page when they send it to you, System Requirements Supported Operating Systems: Windows 2000; Windows Server 2003; Windows Server 2008; Windows Vista; Windows XP Required Software: Access 2000 or later; Full version of Crystal Reports RDC, Report Designer Component 8 or later is required for AccessToCR, Access Whiz Option E; Microsoft .NET Framework SDK 1.x or 2.0 is required for Access Whiz Options A, B, D, F, G and H Display: 1024 x 768 high color I am not sure how helpful .Net 2.0 is going to be when I am doing everything in 3.5 SP1. Also, notice that The full version of Crystal Reports RDC is required to do the report conversions. You might also want to take a look at their FAQ page. There seems to be a lot it does not do. At 12:00 PM 10/16/2009, you wrote: >Date: Fri, 16 Oct 2009 09:09:59 -0500 >From: "Dan Waters" >Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? >To: "'Discussion concerning Visual Basic and related programming > issues.'" >Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD at danwaters> >Content-Type: text/plain; charset="iso-8859-1" > >Hi Shamil, > >This is exactly what I was hoping would be available! Great! > >I have a direct conversion project with 175 forms/reports. Most are simple >but some are complex. I also have 89 standard modules/class modules. SQL >Server 2005 will contain the BE. So, this is a lot of work. > >I did find 2 software utility tools which will do conversion of objects in >Access to objects in VB.Net. > > 1) http://www.microtools.us/ this is $160. > 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. > >If either even works fairly well, that would be the way to go. > >These both have demo versions so if someone wants to try them out and report >back that would be helpful. I don't know enough of VB.Net yet to make a >good assessment. > >Thanks! >Dan From jwcolby at colbyconsulting.com Tue Oct 20 10:45:20 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 11:45:20 -0400 Subject: [dba-VB] C# replace a special character Message-ID: <4ADDDB10.4010703@colbyconsulting.com> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Oct 20 11:21:32 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 20 Oct 2009 18:21:32 +0200 Subject: [dba-VB] C# replace a special character Message-ID: Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From drawbridgej at sympatico.ca Tue Oct 20 11:27:20 2009 From: drawbridgej at sympatico.ca (Jack and Pat) Date: Tue, 20 Oct 2009 12:27:20 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 20 11:33:44 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:33:44 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: I think the overhead of RegEx would be too high on a really large replace. It works great, but it isn't the fastest way. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Tue Oct 20 11:34:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:34:42 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Except the for the semicolon, that's the way to do it in VB.Net too. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 20, 2009 9:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav From marklbreen at gmail.com Tue Oct 20 12:39:06 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 20 Oct 2009 18:39:06 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Hello John, I used the following SQL today, and it works a treat, in my case, I wanted to exclude all except alphas, I know that it is not C#, and I know you may prefer C# as practice, so if it is no useful, just bin it. I got the code from this site, if you have a look, there is a little more there that you may be able to make use of. Thanks to Nigel Rivett. http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html WHILE @@rowcount > 0 UPDATE tablename SET columnname = REPLACE(columnname, SUBSTRING(columnname, PATINDEX('%[^a-zA-Z0-9]%', columnname), 1), '') WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 Mark 2009/10/20 Charlotte Foust > Except the for the semicolon, that's the way to do it in VB.Net too. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Tuesday, October 20, 2009 9:22 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] C# replace a special character > > Hi John > > You should be able to use the Replace method directly on your string > holding the line or the file: > > theStringToCleanUp.Replace(((char)26).ToString(),""); > > like: > > string contents = File.ReadAllText(path); > File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Tue Oct 20 12:47:02 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 10:47:02 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Just a minor note: Even in that small piece of code there is an error. It reads: string output = Regex.Replace(input, "N.t", "NET"); ...but it should read: string output = Regex.Replace(input, "Not", "NET"); Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Tue Oct 20 12:54:31 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 18:54:31 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: <4addf97f.0c11660a.320f.1168@mx.google.com> Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Tue Oct 20 13:10:50 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:10:50 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Message-ID: <9347022991EF4B13A31B779024041F56@creativesystemdesigns.com> I have no idea how fast this 'search and replace' product is but according to a friend, it is a great little product for searching non indexed hard drives... far faster than Windows own indexing, according to him. http://www.inforapid.de/html/searchreplace.htm HTH Jim From accessd at shaw.ca Tue Oct 20 13:29:11 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:29:11 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4addf97f.0c11660a.320f.1168@mx.google.com> References: <4addf97f.0c11660a.320f.1168@mx.google.com> Message-ID: <17B53F39615F4A1BB67C69C33BE5CBB3@creativesystemdesigns.com> STREAMING would be even faster... I switched some ADO code from CHUNK picture data retrieval to ADO to Stream, a number of years ago, on a project and the transfer rate was on an order of magnitude faster. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 20, 2009 10:55 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 20 14:49:26 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 Oct 2009 23:49:26 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Hi John, Try this code snippet changing input and output files' paths: int bufferSize = 1024*1024; string inputFile = @"c:\temp\inputFile.txt"; string outputFile = @"c:\temp\outputFile.txt"; System.IO.FileStream inputStream = new System.IO.FileStream( inputFile, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None, bufferSize); System.IO.FileStream outputStream = new System.IO.FileStream( outputFile, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None, bufferSize); byte[]data = new byte[bufferSize]; int offset = 0; int totalLength = 0; int length = 0; while ((length = inputStream.Read(data, offset, bufferSize)) > 0) { totalLength += length; string text = System.Text.Encoding.ASCII.GetString(data); text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; data = System.Text.Encoding.ASCII.GetBytes(text); outputStream.Write(data, offset, length); } inputStream.Close(); outputStream.Close(); Console.WriteLine("Total length test: {0}", totalLength); HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 7:45 PM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Tue Oct 20 14:53:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:53:22 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <4ADE1532.2000109@colbyconsulting.com> It is my guess that Regex will be too slow. This will be a file with about 100 characters average per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but reading in 200 million bytes all at once could cause issues. John W. Colby www.ColbyConsulting.com Jack and Pat wrote: > John, > > I did a google search to find this link. I'm not a C# person, but thought > I'd pass this on > > http://dotnetperls.com/regex-replace-1 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 11:45 AM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From jwcolby at colbyconsulting.com Tue Oct 20 14:56:33 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:56:33 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADE15F1.1050803@colbyconsulting.com> Thanks Mark. Doing it inside SQL Server is the ideal for sure. ATM I only have the issue in the Address field of the typical FName, LName, Addr, City, St, Zip5, Zip4 record. Thinking about it though you could conceivably have this issue in any field. I will definitely check this out though. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 20 15:00:53 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 16:00:53 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com> <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Message-ID: <4ADE16F5.6030600@colbyconsulting.com> Thanks Shamil! John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Try this code snippet changing input and output files' paths: > > int bufferSize = 1024*1024; > > string inputFile = @"c:\temp\inputFile.txt"; > string outputFile = @"c:\temp\outputFile.txt"; > > System.IO.FileStream inputStream = > new System.IO.FileStream( > inputFile, > System.IO.FileMode.Open, > System.IO.FileAccess.Read, > System.IO.FileShare.None, > bufferSize); > System.IO.FileStream outputStream = > new System.IO.FileStream( > outputFile, > System.IO.FileMode.Create, > System.IO.FileAccess.Write, > System.IO.FileShare.None, > bufferSize); > > byte[]data = new byte[bufferSize]; > int offset = 0; > int totalLength = 0; > int length = 0; > while ((length = inputStream.Read(data, offset, bufferSize)) > 0) > { > totalLength += length; > > string text = System.Text.Encoding.ASCII.GetString(data); > text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; > data = System.Text.Encoding.ASCII.GetBytes(text); > > outputStream.Write(data, offset, length); > } > > inputStream.Close(); > outputStream.Close(); > > Console.WriteLine("Total length test: {0}", totalLength); > > HTH. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 7:45 PM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From stuart at lexacorp.com.pg Tue Oct 20 16:28:39 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 21 Oct 2009 07:28:39 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE1532.2000109@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP>, <4ADE1532.2000109@colbyconsulting.com> Message-ID: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> 200 megabytes tirivial. I just knocked this up in PowerBasic (this is the complete program!): #COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG LOCAL strFile AS STRING LOCAL lngSTart AS LONG LOCAL strData AS STRING strFile = "ML_Data.mdb" lngStart = TIMER OPEN strFile FOR BINARY AS #1 GET$ #1, LOF(1), strData CLOSE #1 REPLACE "A" WITH "B" IN strData OPEN strfile & "fixed" FOR BINARY as#1 PUT$ #1, strData CLOSE #1 MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" END FUNCTION It compiles to an 11KB executable with no dependencies. It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of that time was taken in reading and writing the file to/from memory. -- Stuart On 20 Oct 2009 at 15:53, jwcolby wrote: > It is my guess that Regex will be too slow. This will be a file with about 100 characters average > per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but > reading in 200 million bytes all at once could cause issues. > > John W. Colby > www.ColbyConsulting.com > > > Jack and Pat wrote: > > John, > > > > I did a google search to find this link. I'm not a C# person, but thought > > I'd pass this on > > > > http://dotnetperls.com/regex-replace-1 > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Tuesday, October 20, 2009 11:45 AM > > To: VBA > > Subject: [dba-VB] C# replace a special character > > > > I have a file which contains a sprinkling of a special character - decimal > > 26, hex 1A (the SUB > > character). This special character in the CSV file output to Accuzip causes > > Accuzip to hiccup. In > > order to get on with my life I need to pre-process the files to get rid of > > this special character. > > Because of the size of these files (hundreds of mbytes) I need to do a > > readline / replace / > > writeline kind of thing. I think I need to use the stringbuilder.replace > > but I do not know how to > > specify replacing this hex 1A with something else. The something else would > > ideally be nothing > > (empty string) but can be any valid alpha character (A, B etc). > > > > Can anyone help me with this replace part of the problem. C# syntax please. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From max.wanadoo at gmail.com Tue Oct 20 17:12:19 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 23:12:19 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: What if the input line wont fit into memory? max On 20/10/2009, Stuart McLachlan wrote: > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > >> It is my guess that Regex will be too slow. This will be a file with >> about 100 characters average >> per line, 2 million lines. Doing this in one big read MIGHT be possible >> (and I will try) but >> reading in 200 million bytes all at once could cause issues. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Jack and Pat wrote: >> > John, >> > >> > I did a google search to find this link. I'm not a C# person, but >> > thought >> > I'd pass this on >> > >> > http://dotnetperls.com/regex-replace-1 >> > >> > -----Original Message----- >> > From: dba-vb-bounces at databaseadvisors.com >> > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> > Sent: Tuesday, October 20, 2009 11:45 AM >> > To: VBA >> > Subject: [dba-VB] C# replace a special character >> > >> > I have a file which contains a sprinkling of a special character - >> > decimal >> > 26, hex 1A (the SUB >> > character). This special character in the CSV file output to Accuzip >> > causes >> > Accuzip to hiccup. In >> > order to get on with my life I need to pre-process the files to get rid >> > of >> > this special character. >> > Because of the size of these files (hundreds of mbytes) I need to do a >> > readline / replace / >> > writeline kind of thing. I think I need to use the >> > stringbuilder.replace >> > but I do not know how to >> > specify replacing this hex 1A with something else. The something else >> > would >> > ideally be nothing >> > (empty string) but can be any valid alpha character (A, B etc). >> > >> > Can anyone help me with this replace part of the problem. C# syntax >> > please. >> > >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 21 08:56:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 09:56:21 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF1305.1090809@colbyconsulting.com> Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Jay.Hunnicutt at med.navy.mil Wed Oct 21 09:25:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 10:25:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF1305.1090809@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: John, If you make it a SQL Scalar function you can use it to strip characters for select, Update and insert statements as needed. Makes it a little easier to use as well as reusable. CREATE FUNCTION F_DropSpecChar ( -- Add the parameters for the function here @S varchar(100) ) RETURNS varchar(100) AS BEGIN -- Declare the return variable here DECLARE @Result varchar(100) DECLARE @i INTEGER select @i = patindex('%[^a-zA-Z0-9 ]%', @s) while @i > 0 begin select @s = replace(@s, substring(@s, @i, 1), '') select @i = patindex('%[^a-zA-Z0-9 ]%', @s) end SELECT @Result = @S -- Return the result of the function RETURN @Result END GO Query: select dbo.F_DropSpecChar('qh*(*^&$^1234') Returns: qh1234 Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 9:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I > wanted to exclude all except alphas, I know that it is not C#, and I > know you may prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little > more there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >> Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); File.WriteAllText(path, >> contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:09:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:09:22 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: <4ADF2422.7060204@colbyconsulting.com> I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes it > a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Oct 21 10:23:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:23:43 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF277F.60802@colbyconsulting.com> Mark, Below is the SP I created to perform this magic. I will be running this on 66 million records so we shall see about performance. set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: -- Create date: -- Description: -- --WHILE @@rowcount > 0 -- UPDATE tablename -- SET columnname = REPLACE(columnname, -- SUBSTRING(columnname, -- PATINDEX('%[^a-zA-Z0-9]%', -- columnname), 1), '') -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 -- -- ============================================= ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] -- Add the parameters for the stored procedure here @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @SQL varchar(1000) declare @PatIndex varchar(50) BEGIN TRY set @PatIndex = '%[^a-zA-Z0-9 .,#]%' SELECT @SQL = 'WHILE @@rowcount > 0 UPDATE ' + @DBName + '.dbo.' + @TblName + ' SET ' + @FldName + ' = REPLACE(' + @FldName + ', SUBSTRING(' + @FldName + ', PATINDEX(''' + @PatIndex + ''', ' + @FldName + '), 1), '''') WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' exec (@SQL) print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName END TRY BEGIN CATCH print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName print @SQL print ERROR_MESSAGE() END CATCH END John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark From Jay.Hunnicutt at med.navy.mil Wed Oct 21 10:28:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 11:28:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2422.7060204@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: John, Just add the comma into the accepted characters like patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces and the spaces are left in the return as they are not a part of the condition. Query: select dbo.F_DropSpecChar('abc fge, 123, NC') Returns: abc fge, 123, NC Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 11:09 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes > it a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:46:47 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:46:47 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: <4ADF2CE7.4050902@colbyconsulting.com> Jay, Thanks for that. I figured it out, added the special characters that I need and tested it and it is working great. And pretty darned fast IMHO. I did a replace on one field, 62.8 million records, 2:52 (three minutes). Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores assigned to SQL Server. John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > Just add the comma into the accepted characters like > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > and the spaces are left in the return as they are not a part of the > condition. > > Query: > select dbo.F_DropSpecChar('abc fge, 123, NC') > > Returns: > > abc fge, 123, NC > > Jay Hunnicutt From jwcolby at colbyconsulting.com Wed Oct 21 10:47:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:47:13 -0400 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF277F.60802@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> Message-ID: <4ADF2D01.9000308@colbyconsulting.com> Just an FYI, I ran this against 1 million records, in a query that pulled the top(1000000) City fields (where this specific problem lies) and it took about 13 seconds. This is with an index in place that includes the city field. I then ran it against the entire table (62.8 million records) and it took 2 minutes 52 seconds. This will become a standard part of my program for cleaning up my data. Thanks Mark Breen! John W. Colby www.ColbyConsulting.com jwcolby wrote: > Mark, > > Below is the SP I created to perform this magic. I will be running this on 66 million records so we > shall see about performance. > > set ANSI_NULLS ON > set QUOTED_IDENTIFIER ON > go > > -- ============================================= > -- Author: > -- Create date: > -- Description: > -- > --WHILE @@rowcount > 0 > -- UPDATE tablename > -- SET columnname = REPLACE(columnname, > -- SUBSTRING(columnname, > -- PATINDEX('%[^a-zA-Z0-9]%', > -- columnname), 1), '') > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > -- > -- ============================================= > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > -- Add the parameters for the stored procedure here > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > AS > BEGIN > -- SET NOCOUNT ON added to prevent extra result sets from > -- interfering with SELECT statements. > SET NOCOUNT ON; > declare @SQL varchar(1000) > declare @PatIndex varchar(50) > > BEGIN TRY > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > SELECT @SQL = 'WHILE @@rowcount > 0 > UPDATE ' + @DBName + '.dbo.' + @TblName + ' > SET ' + @FldName + ' = REPLACE(' + @FldName + ', > SUBSTRING(' + @FldName + ', > PATINDEX(''' + @PatIndex + ''', > ' + @FldName + '), 1), '''') > WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' > exec (@SQL) > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > END TRY > BEGIN CATCH > print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > print @SQL > print ERROR_MESSAGE() > END CATCH > END > > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I wanted >> to exclude all except alphas, I know that it is not C#, and I know you may >> prefer C# as practice, so if it is no useful, just bin it. >> >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> PATINDEX('%[^a-zA-Z0-9]%', >> columnname), 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:27:36 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:27:36 +0100 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2CE7.4050902@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> <4ADF2CE7.4050902@colbyconsulting.com> Message-ID: Hello John, As they say, when you only have a hammer, everything looks like a nail. My hammer is my SQL Skills, and I know that I sometimes use them where C# would be more appropriate, I see from Shamils code how easy it is in .Net also, anyway, we all have the options now of c#, PB and TSQL. Glad it worked, thanks Mark 2009/10/21 jwcolby > Jay, > > Thanks for that. I figured it out, added the special characters that I > need and tested it and it is > working great. And pretty darned fast IMHO. I did a replace on one field, > 62.8 million records, > 2:52 (three minutes). > > Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores > assigned to SQL Server. > > John W. Colby > www.ColbyConsulting.com > > > Hunnicutt, Jay E. (Civ) wrote: > > John, > > Just add the comma into the accepted characters like > > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > > and the spaces are left in the return as they are not a part of the > > condition. > > > > Query: > > select dbo.F_DropSpecChar('abc fge, 123, NC') > > > > Returns: > > > > abc fge, 123, NC > > > > Jay Hunnicutt > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:29:54 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:29:54 +0100 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF2D01.9000308@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> <4ADF2D01.9000308@colbyconsulting.com> Message-ID: Hello John, thanks for the credit, but the real credit goes to Nigel Rivett. But thanks anyway Have a nice weekend, Mark Mark Breen said >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> 2009/10/21 jwcolby > Just an FYI, I ran this against 1 million records, in a query that pulled > the top(1000000) City > fields (where this specific problem lies) and it took about 13 seconds. > This is with an index in > place that includes the city field. I then ran it against the entire table > (62.8 million records) > and it took 2 minutes 52 seconds. > > This will become a standard part of my program for cleaning up my data. > > Thanks Mark Breen! > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: > > Mark, > > > > Below is the SP I created to perform this magic. I will be running this > on 66 million records so we > > shall see about performance. > > > > set ANSI_NULLS ON > > set QUOTED_IDENTIFIER ON > > go > > > > -- ============================================= > > -- Author: > > -- Create date: > > -- Description: > > -- > > --WHILE @@rowcount > 0 > > -- UPDATE tablename > > -- SET columnname = REPLACE(columnname, > > -- SUBSTRING(columnname, > > -- > PATINDEX('%[^a-zA-Z0-9]%', > > -- columnname), 1), > '') > > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > -- > > -- ============================================= > > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > > -- Add the parameters for the stored procedure here > > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > > AS > > BEGIN > > -- SET NOCOUNT ON added to prevent extra result sets from > > -- interfering with SELECT statements. > > SET NOCOUNT ON; > > declare @SQL varchar(1000) > > declare @PatIndex varchar(50) > > > > BEGIN TRY > > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > > SELECT @SQL = 'WHILE @@rowcount > 0 > > UPDATE ' + @DBName + > '.dbo.' + @TblName + ' > > SET ' + @FldName + ' = > REPLACE(' + @FldName + ', > > SUBSTRING(' + @FldName + ', > > PATINDEX(''' + @PatIndex + > ''', > > ' + @FldName + > '), 1), '''') > > WHERE PATINDEX(''' + > @PatIndex + ''', ' + @FldName + ') <> 0' > > exec (@SQL) > > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + > @TblName + '.' + @FldName > > END TRY > > BEGIN CATCH > > print 'There was an error REPLACING CHARACTERS IN ' + > @DBName + '.' + @TblName + '.' + @FldName > > print @SQL > > print ERROR_MESSAGE() > > END CATCH > > END > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Mark Breen wrote: > >> Hello John, > >> I used the following SQL today, and it works a treat, in my case, I > wanted > >> to exclude all except alphas, I know that it is not C#, and I know you > may > >> prefer C# as practice, so if it is no useful, just bin it. > >> > >> I got the code from this site, if you have a look, there is a little > more > >> there that you may be able to make use of. > >> > >> Thanks to Nigel Rivett. > >> > >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > >> > >> > >> > >> WHILE @@rowcount > 0 > >> UPDATE tablename > >> SET columnname = REPLACE(columnname, > >> SUBSTRING(columnname, > >> PATINDEX('%[^a-zA-Z0-9]%', > >> columnname), 1), > '') > >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > >> > >> > >> > >> > >> Mark > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:31:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:31:16 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: Hello Stuart, Have not heard of PowerBasic since 2001, is is still in use? or is this an old language that you still use through familiarity? Thanks Mark 2009/10/20 Stuart McLachlan > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > It is my guess that Regex will be too slow. This will be a file with > about 100 characters average > > per line, 2 million lines. Doing this in one big read MIGHT be possible > (and I will try) but > > reading in 200 million bytes all at once could cause issues. > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Jack and Pat wrote: > > > John, > > > > > > I did a google search to find this link. I'm not a C# person, but > thought > > > I'd pass this on > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > To: VBA > > > Subject: [dba-VB] C# replace a special character > > > > > > I have a file which contains a sprinkling of a special character - > decimal > > > 26, hex 1A (the SUB > > > character). This special character in the CSV file output to Accuzip > causes > > > Accuzip to hiccup. In > > > order to get on with my life I need to pre-process the files to get rid > of > > > this special character. > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > readline / replace / > > > writeline kind of thing. I think I need to use the > stringbuilder.replace > > > but I do not know how to > > > specify replacing this hex 1A with something else. The something else > would > > > ideally be nothing > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > Can anyone help me with this replace part of the problem. C# syntax > please. > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 12:53:30 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 18:53:30 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Message-ID: Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark From accessd at shaw.ca Thu Oct 22 13:53:31 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 11:53:31 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Hi Mark: If you are setting up MySQL you should start thinking of using SPs. MySQL version 5 has this feature and pass-through queries in MSAccess, especially SELECT type queries are soooo slowwwwww. Check out the following: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, October 22, 2009 10:54 AM To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Oct 22 15:00:10 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 22 Oct 2009 21:00:10 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Mark, My friend gave me this answer - hope it helps I use the dreamweaver developer toolkit QUB it works exactly like access query's but it's web based and you need both dreamweaver and the developer toolkit to upload the files logon to the mysql then run a query. I've never found one better Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 22 October 2009 18:54 To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 15:57:31 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 06:57:31 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg>, Message-ID: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From accessd at shaw.ca Thu Oct 22 18:57:38 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 16:57:38 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> Message-ID: What sort of speed does PB get? Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, October 22, 2009 1:58 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 22:29:27 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 13:29:27 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, Message-ID: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > From max.wanadoo at gmail.com Fri Oct 23 01:58:47 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 07:58:47 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Message-ID: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> But what can you do with it? I cannot think of anything that I would want to do outside of Access...is that sad or what? Fast is good, but fast doing nothing is nothing. I can do nothing instantaneously! Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 04:29 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Fri Oct 23 05:48:50 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:48:50 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Fri Oct 23 05:54:52 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:54:52 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 08:12:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 14:12:33 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: <4ae1abd3.09c5660a.471e.ffff8b17@mx.google.com> Yes he would have to have dreamweaver installed Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 23 October 2009 11:49 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 09:01:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 10:01:54 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> Message-ID: <4AE1B752.7030306@colbyconsulting.com> > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max From max.wanadoo at gmail.com Fri Oct 23 09:05:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 15:05:33 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Yes, but I do all SQL stuff FROM access. I don't have the performance issues that you do (and I understand where you are at). So, what does PB do that I need to leave Access for? I can do ANYTHING from within Access (speed issues aside) Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 23 October 2009 15:02 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 23 10:01:33 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 23 Oct 2009 10:01:33 -0500 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:02 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 10:24:22 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 19:24:22 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Hi John, I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 6:02 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Oct 23 11:02:26 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 18:02:26 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From jwcolby at colbyconsulting.com Fri Oct 23 11:25:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 12:25:01 -0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Message-ID: <4AE1D8DD.6090103@colbyconsulting.com> Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil From cfoust at infostatsystems.com Fri Oct 23 11:36:18 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 09:36:18 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan From jwcolby at colbyconsulting.com Fri Oct 23 12:00:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 13:00:18 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1E122.1020902@colbyconsulting.com> > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The two > languages will get the missing features from the other and it will then > be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur > with VS 2010 or later. But after the change, using C# or VB.Net will be > just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 12:02:12 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 18:02:12 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1e1ad.170e660a.2cdd.4c8c@mx.google.com> Presumably then, a programmer could use "exactly" the same functionality to achieve "exactly" the same result but could use the language of their choice. Ie. "Good morning", "Guten Morgen" sounds the same to the person who "understands" the output? Ie, BuiltInFunction xyz() has same out put regardless of what constructs/coding was used within the function as long as writing it in BOTH languages achieved the same output. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 23 October 2009 17:36 To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: <000901ca5407$0963f350$1c2bd9f0$@spb.ru> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <000d01ca5407$0ad75970$20860c50$@spb.ru> Hi John, Thank you for your extended comment on "C# vs. native EXE." --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 8:25 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Fri Oct 23 12:51:43 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 10:51:43 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1E122.1020902@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: But I'm not looker for higher pay and higher mystique. I'm 65 and I don't want to program forever or be a consultant at all. VB.Net definitely can do some things C# can't, another reason I never saw much point in learning C# after I made the transition to .Net. We were mandated to use VB.Net because it would make the transition from Access faster. Fine by me. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 10:00 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] c# as a language of choice > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The > two languages will get the missing features from the other and it will > then be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will > be 'equalizing' C# and VB.Net. I don't remember if that's going to > occur with VS 2010 or later. But after the change, using C# or VB.Net > will be just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Oct 23 13:00:40 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 20:00:40 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From accessd at shaw.ca Fri Oct 23 13:09:58 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:09:58 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hi Mark: If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped using ODBC, except in extreme circumstances over 10 years ago and have never looked back. Back in 1997, a client did month end reports through MS Access to a MS SQL BE DB via a pass-through implementation. The report was done in two separate sections with each section taking 50 minutes before the report would start. They would do one report in the morning and one in the afternoon. The query was a 'Select * ..." type. When I converted their month-end report to ADO-OLE and used a SP. The results were that the entire report started in less than 2 seconds. See the sample code at: http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, October 23, 2009 3:55 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:19:10 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:19:10 -0700 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <711C50C13D994C65B774F500045A395D@creativesystemdesigns.com> The truth is that under .Net there is no performance advantage to using VB.Net or C#.Net or any other .Net flavour. Also, you can mix and match code extensions as long as they are not in the same module. The only advantage I can see is that C# sounds cooler... and we know real men and women only use 'C' or derivatives thereof. ;-) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:22:52 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:22:52 -0700 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: Ha ha ha... I guess the universal translator doesn't work... no wonder there are coding problems. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 11:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS2010: Dependency Injection (DI),The Microsoft Extensibility Framework (MEF) Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 13:37:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:37:09 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1F7D5.9020405@colbyconsulting.com> > Not long ago you were just starting to use SQL Server! So much to know, so little time. John W. Colby www.ColbyConsulting.com Dan Waters wrote: > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur with > VS 2010 or later. But after the change, using C# or VB.Net will be just a > syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 23, 2009 9:02 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# replace a special character > > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > That is sad indeed. Nice that you have so much Access work that you never > need to consider anything > else though. > > I have a ton of SQL Server work for one specific client. While I can and do > use Access to perform > this work it is not very efficient. My biggest issue is simply that Access > is single threaded so > when I start a long running stored procedure out on the server, Access comes > to a screeching halt. > > I have logging processes running in the code that executes these stored > procedures. So I time how > long, what the SP name is, what specific file is being created or loaded, > date / time that the step > occurred etc. When a SP starts to run, Access locks up. I cannot see the > status log (through the > Access FE) that tells me where I am in the process. > > As you can see, while Access does function, for this kind of thing it > functions poorly. > > Personally, for a variety of reasons I am moving to C#.Net for this kind of > development. C# is now > widely accepted as a valid language by my clients, it is extremely powerful, > and it is pretty darned > fast, though it will not be as fast as a native EXE. C# has a ton of > database stuff available to it > (though I am not there yet), it has multi-threading (though I am not there > yet), and on a Windows > environment it can do pretty much anything I can imagine doing (and I have a > very active > imagination). Additionally it can be used from right inside of SQL Server > (though I am not there yet). > > For me, C# makes a lot of sense. It has a steep learning curve though. If > it weren't for the fact > that I am a consultant first and foremost, I would go with VB.Net. I > "played" with VB.Net quite a > bit in the past and it was a bit easier to come up to speed on, and every > bit as powerful as C# > within the domain of problems I would ever attempt. > > However if I ever need to sell my .Net skills, C# is just an easier sell. > > John W. Colby > www.ColbyConsulting.com > > > Max Wanadoo wrote: >> But what can you do with it? >> >> I cannot think of anything that I would want to do outside of Access...is >> that sad or what? >> >> Fast is good, but fast doing nothing is nothing. >> >> I can do nothing instantaneously! >> >> Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Oct 23 13:39:48 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:39:48 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: <4AE1F874.1040805@colbyconsulting.com> >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw much > point in learning C# after I made the transition to .Net. We were > mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte From cfoust at infostatsystems.com Fri Oct 23 13:41:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 11:41:19 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1F874.1040805@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> <4AE1F874.1040805@colbyconsulting.com> Message-ID: Even with grown kids, I figure I'll be working the rest of my life too. Just not as a programmer, please. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 11:40 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# as a language of choice >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw > much point in learning C# after I made the transition to .Net. We > were mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Oct 23 16:06:11 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 24 Oct 2009 07:06:11 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Message-ID: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > From max.wanadoo at gmail.com Fri Oct 23 22:44:51 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Sat, 24 Oct 2009 04:44:51 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> Message-ID: <4ae27855.0a04d00a.69f3.ffffd6b8@mx.google.com> Thanks Stuart, I merely meant "from my perspective and from what I do". I am sure there are tons of stuff that other people need. I used to use QB some years back for "quick apps" and it was great. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 22:06 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Oct 24 05:19:17 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 14:19:17 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <000601ca5493$728c8d60$57a5a820$@spb.ru> Hi Dan, Go for C# - VB.NET is usually just 5%(?) closer than C# to "what folks already know" when learning .NET development after VBA/VB6 - spending just a few more time now to adapt to C# syntax you'll gain considerable advantage in long run. But I suppose that using C# from the very beginning will not force to spend more time on learning curve - the opposite is true - why? - keep reading this comment... ...as William noted myriad of times here - there are a lot of C# ready to use samples - that's a very important fact for learning curve and for real life development - despite the fact that there are automatic convertors from C# to VB.NET and vice versa they are not 100% correct but even if they would have been 99% correct you would have been losing time converting C# -> VB.NET and therefore losing advantage in competition with C# developers, and this competition is becoming more and more strict every day... ...using C# you also keep saving time as you do not need to type Function, Sub, Dim, As etc. - in long run that would be a good saving of your life time to be better spent with friends and family than with computers... ...etc... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 7:02 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4537 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Oct 24 10:26:13 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 19:26:13 +0400 Subject: [dba-VB] How to script MS SQL 2005 Database Objects using .NET... Message-ID: <000001ca54be$55977870$00c66950$@spb.ru> Hi All, I'm wondering how to perform the subject task? - similar to MS SQL Management Studio: {{Database}} -> Right-Click -> Tasks -> Generate Scripts.. Etc. I guess is should be possible to write custom code to get SQL DLL scripts for a given set of tables, their relationships and triggers? Is there a ready to use object model for such coding? Or one have to use system (extended) SPs? Or..? I wanted to automate this task. And I do not want to use third-party tools currently. Thank you. -- Shamil From marklbreen at gmail.com Mon Oct 26 02:24:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Oct 2009 07:24:14 +0000 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello All, In the past I found it a PITA to use MS Access as a SQL generator for SQL Server because Access / ODBC drivers applied a prefix of the Scheme name for all the tables - dbo_Customers. This meant that I could not build a query and then copy and paste the SQL unless I first renamed the tables, either manually or with code. However, I can let you know that with the ODBC Driver and the mySQL db that I hooked up to, the tables came with just their names - Customers, so I had a successful session on Friday showing my friend how to build queries. He was delighted, one query that takes three seconds used to take them three days in the past. Interestingly, I did some tests on performace of Linked tables compared to pass-through. The biggest query we ran was a six or seven table query that we saved and then ran a cross tab against that. It ran in 2 - 3 seconds, with all tables linked and no pass through used at all. I have to say in that case, or in similar examples it is not worth while running it as pass-through. I know that in certain cases PST will be faster, but I could not demonstrate a practical example on Friday. I know the benefits, so I am not trying to persuade anyone here, but I am just noting that you may find it is not worth jumping through hoops for PST until you know you need it. Thanks to all, Mark 2009/10/23 Jim Lawrence > Hi Mark: > > If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped > using ODBC, except in extreme circumstances over 10 years ago and have > never > looked back. > > Back in 1997, a client did month end reports through MS Access to a MS SQL > BE DB via a pass-through implementation. The report was done in two > separate > sections with each section taking 50 minutes before the report would start. > They would do one report in the morning and one in the afternoon. The query > was a 'Select * ..." type. > > When I converted their month-end report to ADO-OLE and used a SP. The > results were that the entire report started in less than 2 seconds. See the > sample code at: > > > http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo > rts.asp > > HTH > Jim > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Friday, October 23, 2009 3:55 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello Jim, > thanks for that, yes, I will train him on the benefits of utilising the > Client - Server aspect of the db, > > Just curious though, if I want to return all rows from the web based > hosting > centre, and I have to choices of > a) Select * from Customers ran as a PST query or > b) usp_GetAllCustomers ran as a PST query or > c) Select * from Customers ran as a linked table in Access > > do you think that there would be any noticeable performance difference, my > instinct would be that there would be none. > > Of course if there was a million orders and we wanted to sum all orders > where customer id = 22124, that would have to be better as Pass Through, > but > I would assume minor differences between an sproc and simply including all > the SQL within the PST query. We would loose the precomplile but from a > data and query perspective, I would expect similar (1-2 seconds) > performance. > > Thanks > > Mark > > > > > 2009/10/22 Jim Lawrence > > > Hi Mark: > > > > If you are setting up MySQL you should start thinking of using SPs. MySQL > > version 5 has this feature and pass-through queries in MSAccess, > especially > > SELECT type queries are soooo slowwwwww. > > > > Check out the following: > > > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > > > HTH > > Jim > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > > Sent: Thursday, October 22, 2009 10:54 AM > > To: Discussion of Hardware and Software issues; Discussion concerning > > Visual > > Basic and related programming issues. > > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > > > Hello All, > > I have to assist a friend tomorrow in connecting to a mySQL database and > > starting to build some queries. > > > > I intend to show him the differences between writing queries in MS Access > > when linked to mySQL, and using pass-through queries within Access. > > > > I will also be explaining the benefits of having a few views created > also. > > > > What I am looking for is a Windows based GUI tool that would connect to > > mySQL and allow him to build queries with click and drag like SSMS or > > Access > > does. > > > > This evening I have downloaded and installed two tools, one is the > default > > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > > initial looking anyway, to to allow me to drag a few fields from a table, > > but they do not seems to allow me to drag two or three tables and for the > > joins to be done in the GUI. > > > > Would anyone have any suggestions? > > > > TIA for your time, > > > > Mark > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Oct 26 07:51:17 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 08:51:17 -0400 Subject: [dba-VB] C# - How to access objects in inherited list Message-ID: <4AE59B45.7030003@colbyconsulting.com> Just to learn how, I am trying to subclass a generic list class. My grade calculator previously dimensioned a list and used it. The syntax to access objects in the list in that case was MyList{MyIndex]. In my class definition I subclassed my Grades to inherit the list class. class clsGrades: List { } Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the name of the list property that [] references? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Oct 26 08:13:24 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 09:13:24 -0400 Subject: [dba-VB] C# - How to access objects in inherited list In-Reply-To: <4AE59B45.7030003@colbyconsulting.com> References: <4AE59B45.7030003@colbyconsulting.com> Message-ID: <4AE5A074.50900@colbyconsulting.com> Well, I don't have a clue what I was doing before but this[] does work. My guess is that I was using This[] (capital T) instead of this[]. Anyway, I got it working. Sorry for the ring. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Just to learn how, I am trying to subclass a generic list class. > > My grade calculator previously dimensioned a list and used it. The syntax to access objects in the > list in that case was MyList{MyIndex]. > > In my class definition I subclassed my Grades to inherit the list class. > > class clsGrades: List > { > } > > Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the > life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the > name of the list property that [] references? > > TIA > From dwaters at usinternet.com Mon Oct 26 12:03:22 2009 From: dwaters at usinternet.com (Dan Waters) Date: Mon, 26 Oct 2009 12:03:22 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? Message-ID: Hello! I have some code from a forum that I believe may allow dragging a file to an Access for so that the file's full path can be captured by the form. If this can be done, then a file can be very easily 'attached' to an Access database. The code comes from here: http://bytes.com/topic/access/answers/197392-drag-drop The code was originally written by Felix Lima (MS Support Engineer), and posted by Stephen Lebans. I first tried putting this code into an mdb, but the database froze because the code that was waiting for a Windows Message ran continuously. So, I want to ask if someone can take this code and put it into a DLL file like Felix says it should be. I've put it all into a small Access file that I can send to you. If this works, I'll post a 'how to' in DB Advisors. Thanks! Dan From davidmcafee at gmail.com Mon Oct 26 12:11:52 2009 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 26 Oct 2009 10:11:52 -0700 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: Message-ID: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From DWUTKA at Marlow.com Tue Oct 27 12:05:18 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 27 Oct 2009 12:05:18 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Monday, October 26, 2009 12:12 PM To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 dwaters at usinternet.com Tue Oct 27 18:53:27 2009 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 27 Oct 2009 18:53:27 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew From michael at ddisolutions.com.au Tue Oct 27 19:03:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 28 Oct 2009 11:03:17 +1100 Subject: [dba-VB] Create a DLL for Access Drag Drop? References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015825AE@ddi-01.DDI.local> Hi Dan, In the dim dark past I think I did something like this. IIRC you supply the Data object (can be anything) in the StartDrag(?) event. I could be wrong... Cheers Michael Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Oct 28 15:29:26 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 28 Oct 2009 15:29:26 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Close your database, and reopen it. DO NOT go into any VBA code AT ALL. See if your procedure works. It probably should (though I haven't actually tried your code). The problem is that when ANY callback function runs, if the VBE has been opened, it will freak Access out like crazy! As for code to use a treeview: Option Compare Database Dim tvw As TreeView Private Sub Form_Load() Set tvw = Me.TreeView0.Object End Sub Private Sub Form_Unload(Cancel As Integer) Set tvw = Nothing End Sub Private Sub TreeView0_OLEDragDrop(Data As Object, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim nd As Node Select Case DetermineDropType(Data) Case "TEXT" Case "FILES" Case Else MsgBox "Invalid Object Type" End Select End Sub Function DetermineDropType(Data As Object) As String On Error Resume Next Dim strTemp As String strTemp = Data.GetData(1) If Not Err Then DetermineDropType = "TEXT" Exit Function End If Err.Clear If Data.Files.Count > 0 Then DetermineDropType = "FILES" End If End Function In the case 'FILES' you would use something like: For i=1 to Data.Files.Count strPath=DataFiles(i) 'do something with strpath Next i Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Tuesday, October 27, 2009 6:53 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or 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 Oct 1 14:47:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 15:47:08 -0400 Subject: [dba-VB] MySQL Message-ID: <4AC5073C.5050102@colbyconsulting.com> I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- John W. Colby www.ColbyConsulting.com From max.wanadoo at gmail.com Thu Oct 1 14:59:28 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 1 Oct 2009 20:59:28 +0100 Subject: [dba-VB] [AccessD] MySQL In-Reply-To: <4AC5073C.5050102@colbyconsulting.com> References: <4AC5073C.5050102@colbyconsulting.com> Message-ID: <4ac50a3a.0707d00a.659c.2f57@mx.google.com> No, but you might want to do it with Virtual Box (free from Sun). Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 01 October 2009 20:47 To: Access Developers discussion and problem solving; VBA Subject: [AccessD] MySQL I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- 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 Thu Oct 1 20:03:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 21:03:22 -0400 Subject: [dba-VB] SQL Server not locking up Message-ID: <4AC5515A.3070008@colbyconsulting.com> I am hesitantly declaring victory in the SQL Server war. I am going to award Nancy Lytle the award for the correct solution, with the proviso that she has to give it back if it turns out that the wily server misbehaves again. Since setting Max Degree of Parallelism to 3 I have not been locked out again. Understand that about this same time I also changed processor I/O affinity to only use the same three CPUs that I set CPU affinity for. And I have had so many problems with this, where it went away and then came back that I am very hesitant to declare victory but I did want to report back that the "locking up" issue hasn't recurred lately. Thanks go to everyone who volunteered suggestions. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 05:43:02 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 14:43:02 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: <002501ca4671$c8bfc420$5a3f4c60$@spb.ru> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From Gustav at cactus.dk Tue Oct 6 06:41:31 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Oct 2009 13:41:31 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Oct 6 07:37:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 Oct 2009 08:37:19 -0400 Subject: [dba-VB] Top 25 most dangerous programming errors Message-ID: <4ACB39FF.5030302@colbyconsulting.com> I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] Top 25 most dangerous programming errors In-Reply-To: <4ACB39FF.5030302@colbyconsulting.com> References: <4ACB39FF.5030302@colbyconsulting.com> Message-ID: <005e01ca46b3$6eccdb50$4c6691f0$@spb.ru> Hi John, Yes, that is a very useful site, thank you for sharing the link. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 06, 2009 4:37 PM To: Access Developers discussion and problem solving; VBA; Dba-Sqlserver Subject: [dba-VB] Top 25 most dangerous programming errors I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 13:45:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 19:45:00 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Message-ID: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 6 15:35:40 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 00:35:40 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Message-ID: <007701ca46c4$92e02d60$b8a08820$@spb.ru> Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 15:39:41 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 21:39:41 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <007701ca46c4$92e02d60$b8a08820$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> <007701ca46c4$92e02d60$b8a08820$@spb.ru> Message-ID: <4acbab22.0a1ad00a.7ab2.40ff@mx.google.com> I just saw the headlines on that link I sent you. You will have to read through what is on offer. They do all sorts of things on all sorts of platforms for all sorts of systems. It is really just a pick-and-mix for whatever you need. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 21:36 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Oct 7 07:53:48 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 14:53:48 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Wed Oct 7 08:31:08 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 17:31:08 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <009501ca4752$6f1073c0$4d315b40$@spb.ru> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 7 08:46:29 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 15:46:29 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil I believe they offer all of the three common scenarios: 1. Hosted in a shared environment (virtual) where you cannot install anything special 2. Hosting of a dedicated server provided by you or your client, installed as you like 3. Hosting of a dedicated server supplied by Verinet for your exclusive use, remotely installed by you I'll ask when my contact replies about your options. And yes, that is the exchange rate. /gustav >>> shamil at smsconsulting.spb.ru 07-10-2009 15:31 >>> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri Oct 9 11:24:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Oct 2009 12:24:52 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class Message-ID: <4ACF63D4.7090001@colbyconsulting.com> I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Oct 9 17:00:05 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 02:00:05 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4ACF63D4.7090001@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> Message-ID: <003601ca492b$dd700d50$985027f0$@spb.ru> Hi John, You can put your initialization code into your form constructor or Form_Load event processing method. BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP when programming on C# - and you'll feel a great relieve. Guaranteed/tested/proven by many developers. There are .NET natural naming conventions recommended by MS. Try to find and use them. Here is one source: http://www.irritatedvowel.com/Programming/Standards.aspx Here is a VS plug-in to help you get accustomed to the new naming conventions: http://www.codeplex.com/StyleCopForReSharper Although I haven't used it yet. --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 09, 2009 8:25 PM To: VBA Subject: [dba-VB] Error when passing controls to the constructor of a class I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Sat Oct 10 08:35:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 10 Oct 2009 09:35:01 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <003601ca492b$dd700d50$985027f0$@spb.ru> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> Message-ID: <4AD08D85.5030308@colbyconsulting.com> Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > From shamil at smsconsulting.spb.ru Sat Oct 10 11:18:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 20:18:53 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4AD08D85.5030308@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> <4AD08D85.5030308@colbyconsulting.com> Message-ID: <000601ca49c5$5dfbabc0$19f30340$@spb.ru> Hi John -- Yes, it works well for me - programming without Hungarian notation in .NET development - they say Hungarian is not needed because you can always use Intellisense to see the type of variables etc. I still use Hungarian notation sometimes in control names, and always when naming MS SQL views, SPs, UDFs, triggers... As for inconsistency in MS internal code - I suppose they can't quit Hungarian notation habits overnight - but they are moving in the new direction for sure... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, October 10, 2009 5:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Error when passing controls to the constructor of a class Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4495 (20091010) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Mon Oct 12 21:35:07 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 12 Oct 2009 22:35:07 -0400 Subject: [dba-VB] C# serialization Message-ID: <4AD3E75B.2070006@colbyconsulting.com> I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Oct 12 22:29:00 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 13 Oct 2009 14:29:00 +1100 Subject: [dba-VB] C# serialization References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015824EA@ddi-01.DDI.local> Hi John, I did this a few years ago and the project got canned so beware :-). It only works with a single class at a time IIRC. Maybe LINQ to XML might be the way to go for building nested related objects? Just struggling through some of this myself, but I'm working from existing XML data. Look at creating XML trees. http://msdn.microsoft.com/en-us/library/bb387068.aspx good luck Michael M using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.IO; using System.Xml.Serialization; /// /// Serializes and deserializes Layout objects /// public class Serializer { public Serializer( ) { } /// /// Serializes the Layout object /// /// /// public void SerializeNow( string filePath, T source, SerializationFormat format ) { if ( source == null ) throw new ArgumentNullException( "source", "Invalid object to serialize" ); if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format ) { case SerializationFormat.Xml: // Insert code to set properties and fields of the object. XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); // To write to a file, create a StreamWriter object. using ( StreamWriter myWriter = new StreamWriter( "PedalMap.xml" ) ) { mySerializer.Serialize( myWriter, source ); myWriter.Close( ); } break; case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.OpenOrCreate, FileAccess.Write ) ) { BinaryFormatter b = new BinaryFormatter( ); b.Serialize( fs, source ); } break; } } /// /// Deserializes the Layout object /// /// /// public T DeSerializeNow( string filePath, SerializationFormat format ) { if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format) { case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.Open, FileAccess.Read ) ) { BinaryFormatter b = new BinaryFormatter( ); try { return ( T ) b.Deserialize( fs ); } catch { return default( T ); } } case SerializationFormat.Xml: XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); using ( StreamReader myReader = new StreamReader( filePath ) ) return ( T ) mySerializer.Deserialize( myReader ); } return default( T ); } } The object to serialize, add the Serializable( ) attribute to the class. [Serializable( )] //Set this attribute to all the classes that want to serialize public class PedalMap { public PedalMap( ) { } //Add your properties here } You call it like so... Serializer s = new Serializer( ); s.SerializeNow( Application.ExecutablePath, _pmap, SerializationFormat.Xml ); -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 13 October 2009 1:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 13 09:54:36 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 07:54:36 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD3E75B.2070006@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: John, I'm not sure I understand what you're doing. Do these classes inherit typed datasets? If so, the parent class can easily return a child class that already contains a typed dataset of child records. You don't actually need collections for that. In that case, grade wouldn't need to be a class (although it could be, I just don't see any need). The Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, October 12, 2009 7:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Oct 13 10:37:59 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:37:59 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <4AD49ED7.5060300@colbyconsulting.com> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From cfoust at infostatsystems.com Tue Oct 13 10:39:40 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 08:39:40 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD49ED7.5060300@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: You can build a typed dataset on an xml file John. Doesn't require a database. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:38 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child > class that already contains a typed dataset of child records. You > don't actually need collections for that. In that case, grade > wouldn't need to be a class (although it could be, I just don't see > any need). The > > Charlotte Foust From Gustav at cactus.dk Tue Oct 13 10:57:22 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 17:57:22 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Sounds like a quite normal database app to me ... If so, all the typed dataset stuff is ready at your hands. To persist (to an XML file without the overhead you claim about) use method WriteXml. To read it at load, use method ReadXml. Can't be simpler. Of course, I can see an educational purpose by handcrafting a kind of database, but ... /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 10:59:49 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:59:49 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: <4AD4A3F5.5030509@colbyconsulting.com> That's nice Charlotte, but I assume that I would have to completely rewrite some level of how I do things. I would certainly welcome knowing how to do that but I don't want to do so at this moment. If this has anything to do with ADO and all of that stuff, I will be getting into that later. A year or so ago I used something similar to what I am doing now and just used serialization to write it out to a stream and later read it back in. I know from experience that once you are up to speed on the syntax of a language, it is easy to forget what a PITA all the nitpicking details are. I am still dealing with [] instead of () for the collections, explicit data type conversions and all the rest of the stuff that you don't even remember learning. "Building a typed dataset" of any kind is not where I am right now, never mind "on an XML file". Have patience Master. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > You can build a typed dataset on an xml file John. Doesn't require a > database. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 8:38 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply > input a list of grades. > There are three types of grades, each with a different weight (Tests - > 40% of grade, Labs - 50% of grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating > a total count of each grade type, sum of each type, average of each type > and weighted average of each type, and then the same calculations for > the totals. > > In order not to be bored to death, and with the approval of the > instructor, I expanded the assignment to include using classes and > collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) > which contains a generic collection into which the instances of clsGrade > are inserted. This collection is strongly typed so that it can only > accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in > clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or > "DL"). In the main form there is a combo with three grade type strings > ("Test", "Lab" and "DL") which when selected is passed in to > clsCalculator which indexes into the collection to access the correct > instance of clsGrades. Adding new grades, deleting grades and updating > existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection > holding three instances of... > clsGrades - contains a strongly typed generic collection holding > multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, > average and weighted average all of the grades contained within. > > clsCalculator requests the various computed values from the three > instances of clsGrades and performs the calculations to create an > overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), > Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, > then read it back in again. > Persist the grades to disk. I have no requirement to persist the data > to disk, I simply want to do so. > > Please please please do not suggest a "better way" for doing the > assignment, it is all written and functions exactly as you would expect > it to work. You may of course enlighten me on different options, but I > will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I > can persist it great, if not that's OK too. I have learned a lot and > thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a > "next semester" thing so I am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit > >> typed datasets? If so, the parent class can easily return a child >> class that already contains a typed dataset of child records. You >> don't actually need collections for that. In that case, grade >> wouldn't need to be a class (although it could be, I just don't see >> any need). The >> >> Charlotte Foust > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 13 11:13:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:13:13 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4A719.9090900@colbyconsulting.com> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Tue Oct 13 11:34:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 18:34:38 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 11:43:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:43:39 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4AE3B.1010205@colbyconsulting.com> I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at > typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at > that level. > > I am quite sure that in a year I will be throwing out typed datasets with the best of them but right > now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav From cfoust at infostatsystems.com Tue Oct 13 12:10:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 10:10:19 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4AE3B.1010205@colbyconsulting.com> References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: John, Typed datasets ARE serialized. That's the point. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 9:44 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to > LEARN C#. You do not start at typed data sets, you start with "this > is a variable" and "this is a for loop". I am very much at that level. > > I am quite sure that in a year I will be throwing out typed datasets > with the best of them but right now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Oct 13 13:19:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 14:19:30 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: <4AD4C4B2.9020600@colbyconsulting.com> Charlotte, No, the point is that datasets are over my head at this point in the journey. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > Typed datasets ARE serialized. That's the point. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 9:44 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > I am under the impression that you can write ANY repeating sequence such > as these grade classes to XML and read them back rather easily, using > serialization. However the only examples I am seeing are from back in > 100, 2002, 2004. A lot has happened since then, so I figured to get > modern examples of the same thing. Google is not being my friend ATM. > > As I said, I did this in VB, but cannot find my old code. > > I will certainly end up doing the database thing, but I want to get the > basic C# syntax down before I go there. I am still thumbing through my > book for the simplest little things. > > John W. Colby > www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 13 14:26:44 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 13 Oct 2009 23:26:44 +0400 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4A719.9090900@colbyconsulting.com> References: <4AD4A719.9090900@colbyconsulting.com> Message-ID: <003601ca4c3b$1a8cb190$4fa614b0$@spb.ru> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (part 1_ Message-ID: <004701ca4c41$9a7451a0$cf5cf4e0$@spb.ru> Hi John, The below approach and XmlArray attribute can be used for your sample/test case - the below posting didn't get dba-VB moderation on 20-SEP-09 : << Your mail to 'dba-VB' with the subject JSON and XML in memory serialization sample code Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 39406 bytes with a limit of 20 KB >> So I'm posting it here split into three parts: From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Sunday, September 20, 2009 6:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: JSON and XML in memory serialization sample code Hi All, Related to recent John post here (see P.S.) is a sample code of JSON and XML in memory serialization - how I do it usually. My question is do you know a way to implement XML in memory serialization using less code lines? I do use this XML code serialization for quite some time and I could have some new features, which could allow to simplify this code: Thank you. --Shamil P.S. Code sample - watch line wraps! - this code was nicely formatted here but when it will go through Internet it will get lines wrapped but anyway it should work - just edit comment lines and add references to System.Web and System.Web.Extensions assemblies: Continued in the next posting: From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 2) Message-ID: <004201ca4c41$992b56e0$cb8204a0$@spb.ru> Continued. using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; using System.Web.Script.Serialization; namespace ConsoleApplication1 { [XmlType("phoneBookEntry")] public class PhoneBookEntry { [XmlAttribute("firstName")] public string FirstName {get;set;} [XmlAttribute("lastName")] public string LastName { get; set; } [XmlAttribute("phoneName")] public string Phone { get; set; } } class Program { static void Main(string[] args) { PhoneBookEntry entry = new PhoneBookEntry(); entry.FirstName = "Peter"; entry.LastName = "Brown"; entry.Phone = "+7-921-1234567"; JavaScriptSerializer js = new JavaScriptSerializer(); string jsEntry = js.Serialize(entry); Console.WriteLine("1. JSON string\n{0}", jsEntry); PhoneBookEntry[] entries = { entry, entry, entry }; string jsEntries = js.Serialize(entries); Console.WriteLine("1. JSON array\n{0}", jsEntries); string xmlEntry = InMemoryObjectsSerializer.Serialize(entry); Console.WriteLine("1. XML string\n{0}", xmlEntry); string xmlEntries = InMemoryObjectsSerializer.Serialize(entries); Console.WriteLine("1. XML array\n{0}", xmlEntries); } } To be continued in part 3. From shamil at smsconsulting.spb.ru Tue Oct 13 15:17:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:17:52 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.2) Message-ID: <004c01ca4c42$3f63fb70$be2bf250$@spb.ru> Continued (from 3.1). /// /// In memory object data serialization /// public class InMemoryObjectsSerializer { /// /// Cconverts a custom object instance to XML string /// /// Object that is to be serialized to XML /// XML string in UTF8 format public static String Serialize(Object pObject) { String XmlizedString = null; MemoryStream memoryStream = new MemoryStream(); XmlSerializer xs = new XmlSerializer(typeof(T)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); xs.Serialize(xmlTextWriter, pObject); memoryStream = (MemoryStream)xmlTextWriter.BaseStream; XmlizedString = StringToBytes.UTF8ByteArrayToString(memoryStream.ToArray()); return XmlizedString; } /// /// Reconstruct an object instance from XML string /// /// Xml string to be used for object instance deserialization /// public static Object Deserialize(String pXmlizedString) { XmlSerializer xs = new XmlSerializer(typeof(T)); MemoryStream memoryStream = new MemoryStream(StringToBytes.StringToUTF8ByteArray(pXmlizedString)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); return xs.Deserialize(memoryStream); } } } From shamil at smsconsulting.spb.ru Tue Oct 13 15:20:31 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:20:31 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.1) Message-ID: <005601ca4c42$9dfc7180$d9f55480$@spb.ru> From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Wednesday, October 14, 2009 12:13 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: FW: JSON and XML in memory serialization sample code (Part 3) Continued from Part 2. /// /// Converts strings to byte arrays and vice versa /// public class StringToBytes { /// /// Converts a Byte Array of Unicode values (UTF-8 encoded) to a complete String. /// /// Unicode Byte Array to be converted to String /// String converted from Unicode Byte Array public static String UTF8ByteArrayToString(Byte[] characters) { UTF8Encoding encoding = new UTF8Encoding(); String constructedString = encoding.GetString(characters); return (constructedString); } /// /// Converts the String to UTF8 Byte array and is used in De serialization /// /// /// public static Byte[] StringToUTF8ByteArray(String pXmlString) { UTF8Encoding encoding = new UTF8Encoding(); Byte[] byteArray = encoding.GetBytes(pXmlString); return byteArray; } } To be continued in Part 3.2.. From Gustav at cactus.dk Tue Oct 13 16:25:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 23:25:35 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav From shamil at smsconsulting.spb.ru Tue Oct 13 17:28:47 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 02:28:47 +0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <005b01ca4c54$892d1f40$9b875dc0$@spb.ru> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 14, 2009 1:26 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# serialization Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 14 02:52:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 09:52:03 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks, I understand that now. /gustav >>> shamil at smsconsulting.spb.ru 14-10-2009 00:28 >>> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil From jwcolby at colbyconsulting.com Wed Oct 14 12:37:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 13:37:15 -0400 Subject: [dba-VB] Merge / Purge Message-ID: <4AD60C4B.2030706@colbyconsulting.com> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Oct 14 12:52:41 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 19:52:41 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John I would skip the update and delete parts as these are very slow. Instead, read/loop through the sorted table and append the single records to a new table. Thus: 1. Sort by name and "recenty" (what is the word for this, the most recent?) 2. Loop while collecting data for each name 3. For each name, append the collected and arranged data to the new (cleaned) table 4. Leave the old table as a backup I haven't worked with that many records so I cannot tell which coding method will turn out fastest. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Oct 14 13:05:50 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:05:50 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD612FE.5010107@colbyconsulting.com> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From Gustav at cactus.dk Wed Oct 14 13:19:23 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 20:19:23 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. From jwcolby at colbyconsulting.com Wed Oct 14 13:31:14 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:31:14 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD618F2.3080407@colbyconsulting.com> Further to this. I have a hash field which contains an SH1 hash for FName + LName + Addr + Zip5 + Zip4. These hash strings are absolutely unique (tested and confirmed) so what I am doing is pulling a view grouped by hash key where Count(PK) > 1. This gives me the data set of all hash keys of multiple ("dupes") records. In fact the hash key (and in fact all name / address fields) are out in a separate table related 1 to 1 with the fact table which I am "merging". Thus the hash would really pull a set of PKIDs which would be used to pull all of the fact records for the person that the hash key belongs to. Once those fact records are sitting in memory I would thing the update code would zip pretty well. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From jwcolby at colbyconsulting.com Wed Oct 14 13:39:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:39:10 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61ACE.6030707@colbyconsulting.com> You are right of course but I am thinking the update would just fly. There are about 550 fields in the fact table. Thus I would be comparing / updating 550 fields, sequentially, between Rec1 and Rec2. Then Rec2 / Rec3, Rec1 / Rec4 etc until all fact records for a given hash key (person) are finished. The "facts" can be anything from strings of 20-30 bytes down to a simple "Y". The vast majority of fields contain "Y" or nothing. A small minority contain codes ('A' - 'T') for example. And a very small number contain somewhat longer strings. This is not a transaction database so there will be no locking contentions etc. Just me and my update program whistling away. I will be working on a copy of the main table of course. Maybe writing modified (Record1) to one table and deleted (Records 2-N) to another table. At the end do the deletes / inserts. It probably will pay to copy all of the duplicate fact records out to a temp table and work on that as the source table. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 14 13:41:03 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:41:03 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61B3F.8000409@colbyconsulting.com> This is exactly the kind of stuff that I am taking my class for. C# is so much more faster / powerful than VBA in this kind of processing. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Wed Oct 14 14:51:07 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 15 Oct 2009 05:51:07 +1000 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD61B3F.8000409@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com> Message-ID: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> John, > >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > >> position, NOT date (I don't have date info). SQL Server doesn't have a concept of chronological record position. Unless there is atimestamp or incrementing field, there is no way to know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. Do use have an incrementing key field? Stuart McLachlan From jwcolby at colbyconsulting.com Wed Oct 14 15:19:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 16:19:54 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> References: , <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> Message-ID: <4AD6326A.4080708@colbyconsulting.com> Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. Unless there is > atimestamp or incrementing field, there is no way to know which is the most recent entry or > to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From cfoust at infostatsystems.com Wed Oct 14 16:20:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 14 Oct 2009 14:20:42 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6326A.4080708@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: Unless they have data in the same fields. Then what happens? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 14, 2009 1:20 PM To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Merge / Purge Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. >>>> "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent >>>> data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. > Unless there is atimestamp or incrementing field, there is no way to > know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 14 22:18:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 23:18:19 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: <4AD6947B.8090807@colbyconsulting.com> Charlotte, > Unless they have data in the same fields. Then what happens? Well, so what? Either overwrite or don't. Remember it is impossible to tell which is correct. They can't BOTH be correct. Flip a coin and do something, it literally doesn't matter what. John Colby Owns_A_Dog = 'Y' John Colby Owns_A_Dog = 'N' Which one is true? We have no way to say one record is more recent so flip a coin and merge the data. In fact in most cases (90% of all the fields) the data is "Y" or nothing. These records are the result of people taking polls. So in 90% of the cases, the person will answer "Y" or they have no answer because they weren't asked that question in that poll. The objective here is to get a ton of individual poll responses merged into a single record. I did a count earlier today and one person is in the database 36 times, 26 times, 17, 16, two 14s, four 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million total records). So when I try to ask the question "income bracket in (A-T)" and ("Owns a dog" OR "owns a cat") AND "mail order buyer", I end up with cases where "Owns a dog" was answered in one record and "mail order buyer" was answered in another record. So the AND fails whereas in fact the person answered affirmatively to both questions, just not in the same record. This is nuts. I need to merge things down so that there is a single record for a single person. ALL ANSWERS need to be in one record. If there are conflicting records, flip a coin, pick one answer. Now before you go off on normalization and a single column fact table, just remember that I have 50 million records X 550 columns. A single column fact table would end up with 25 Tera records and I don't have a supercomputer. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Unless they have data in the same fields. Then what happens? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 14, 2009 1:20 PM > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > related programming issues. > Subject: Re: [dba-VB] Merge / Purge > > Stuart, > > Yes there is a PKID. The thing is, every record is equal so it simply > doesn't matter in which order the records are pulled. Any of the > duplicates can be treated as the first record to be updated by whatever > is found in the subsequent records. > > It literally doesn't matter which record is encountered first. > > John W. Colby > www.ColbyConsulting.com From dbdoug at gmail.com Wed Oct 14 22:30:51 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 14 Oct 2009 20:30:51 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6947B.8090807@colbyconsulting.com> References: <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> <4AD6947B.8090807@colbyconsulting.com> Message-ID: <4dd71a0c0910142030vb19034fh7e316528476dcbca@mail.gmail.com> On Wed, Oct 14, 2009 at 8:18 PM, jwcolby wrote: > Charlotte, > > > Unless they have data in the same fields. Then what happens? > > Well, so what? Either overwrite or don't. Remember it is impossible to > tell which is correct. > They can't BOTH be correct. Flip a coin and do something, it literally > doesn't matter what. > > John Colby Owns_A_Dog = 'Y' > John Colby Owns_A_Dog = 'N' > > Which one is true? We have no way to say one record is more recent so flip > a coin and merge the data. > > In fact in most cases (90% of all the fields) the data is "Y" or nothing. > These records are the > result of people taking polls. So in 90% of the cases, the person will > answer "Y" or they have no > answer because they weren't asked that question in that poll. > > The objective here is to get a ton of individual poll responses merged into > a single record. I did > a count earlier today and one person is in the database 36 times, 26 times, > 17, 16, two 14s, four > 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million > total records). > > So when I try to ask the question "income bracket in (A-T)" and ("Owns a > dog" OR "owns a cat") AND > "mail order buyer", I end up with cases where "Owns a dog" was answered in > one record and "mail > order buyer" was answered in another record. So the AND fails whereas in > fact the person answered > affirmatively to both questions, just not in the same record. This is > nuts. I need to merge things > down so that there is a single record for a single person. ALL ANSWERS > need to be in one record. > If there are conflicting records, flip a coin, pick one answer. > > Now before you go off on normalization and a single column fact table, just > remember that I have 50 > million records X 550 columns. A single column fact table would end up > with 25 Tera records and I > don't have a supercomputer. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: > > Unless they have data in the same fields. Then what happens? > > > > Charlotte Foust > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Wednesday, October 14, 2009 1:20 PM > > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > > related programming issues. > > Subject: Re: [dba-VB] Merge / Purge > > > > Stuart, > > > > Yes there is a PKID. The thing is, every record is equal so it simply > > doesn't matter in which order the records are pulled. Any of the > > duplicates can be treated as the first record to be updated by whatever > > is found in the subsequent records. > > > > It literally doesn't matter which record is encountered first. > > > > John W. Colby > > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dwaters at usinternet.com Thu Oct 15 17:56:00 2009 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 15 Oct 2009 17:56:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Message-ID: I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan From shamil at smsconsulting.spb.ru Fri Oct 16 06:24:20 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 15:24:20 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 07:16:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 08:16:46 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <4AD8642E.6020103@colbyconsulting.com> It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Oct 16 07:26:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 16:26:53 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD8642E.6020103@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> Message-ID: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Hi John, Thank you for your remark. 1 form/report times 2.5 works rather well provided existing functionality is preserved. For new projects 1 (final) form/report times 4 is a better ballpark figure. This is software development industry wide experience. It doesn't matter what framework etc. is used. BTW, your framework could be relatively easy ported to .NET, I suppose. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 4:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 08:16:51 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 09:16:51 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Message-ID: <4AD87243.8080200@colbyconsulting.com> Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Thank you for your remark. > > 1 form/report times 2.5 works rather well provided existing functionality is > preserved. For new projects 1 (final) form/report times 4 is a better > ballpark figure. This is software development industry wide experience. It > doesn't matter what framework etc. is used. BTW, your framework could be > relatively easy ported to .NET, I suppose. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 4:17 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? > > It also depends on many other things. For example if you were to convert > one of my projects you > would be facing my framework and tons of classes and modules. That stuff > might just convert but > maybe not. How about DAO specific code in modules? I reference databases, > recordsets, fields, even > properties of fields, I use dynamic queries modifying TDFs in code, I build > dynamic SQL and execute > it with the database object. > > I have error logging, login logging, usage of forms logging. I control > access to forms and controls > on forms based on user/group/usergroup security, manipulating Enabled, > Locked and Visible properties > based on the user rights. I control subform loading based on whether a ton > of controls two forms up > have valid data in them, allowing supervisors to override but not normal > users. > > Also what BE are you going to? SQL Server? Staying with an MDB? How about > VBA functions embedded > in queries? Are you moving from DAO bound to ADO unbound? Are you setting > a DAO recordset to the > form's recordset clone and then doing stuff behind the scenes? I am now > using pass through queries > to pull data from SQL Server views. > > How about import / export of data? My applications strip files off of email > and download from FTP > sites, and even watch directories, then convert to / from CSV and fixed > width files, importing and > exporting to tables. I have table driven code which builds fixed width > reports with header and > footer information based on mainframe specs provided by banks and insurance > companies. > > Your formula would probably work if the original was written by a power user > (or summer intern in > the case of NorthWind). I would be VERY hesitant to make a firm quote on > such a rule of thumb. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hello Dan, >> >> I'd count it as one form/report => 1 day => times 2.5 = that would include >> all project costs not only development. >> But if you do not plan to change any functionality then it can be done >> quicker - here is a real life conversion case's stats online: >> >> http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 >> >> The estimations were between 45 and 165 hours - just for conversion >> development work - average estimation was exactly around the final figure: >> ~65 hours for 35 forms/reports (with subforms/sureports). Final result is >> not "industry strong" - it would need another 60 hours to make it > "industry >> strong", even more time would be needed to write docs and online help if >> needed etc. - all in all it will be 1 day for 1 form/report for such a >> simple application... >> >> Of course it also depends on how experienced your developers are, what >> architecture your converted system is planned to have etc. >> >> Thank you. >> >> -- >> Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 08:57:25 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 17:57:25 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD87243.8080200@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> <4AD87243.8080200@colbyconsulting.com> Message-ID: <006f01ca4e68$989fdf60$c9df9e20$@spb.ru> Hi John, You can use DAO in C#/VB.NET, although you can't bind forms/reports (MSReportViewerControl) to DAO recordsets therefore yes, DAO has to be removed I suppose. But if you're so "sticky" (:) kidding) to DAO you can model/simulate it via ADO.NET. It shouldn't be a big issue to create wrapper classes simulating DAO (the DAO features you use - this subset is rather limited I expect) but using ADO.NET, and then that wrapper classes can have properties, which can be bound to e.g. WinForms... WithEvents is everywhere in .NET - you'll feel OK with that. WinForms events do differ from MS Access forms' ones but you can find good equivalents I suppose. All in all I still suppose that conversion of your framework to .NET wouldn't be a complicated task - I'd propose to do that conversion not literally but conceptually - preserving your framework's principles/concepts/architecture but substituting (and not trying to simulate) technologies as DAO with the .NET native ones... I must also note that nowadays (in the near future with release of .NET Framework 4.0/VS 2010) we will get so powerful framework from MS that developing custom frameworks would become an overkill... <<< Microsoft kindly gave us the DAO object model and I know it (and program it) very well. >>> Well, DAO forced so many developers to think too straightforward navigational way, and it (DAO) was developed the time when it was already clear for many years that a one working with relational databases should better use "set thinking" approach - it was a real PITA to use DAO all that years, how many "spaghetti" code was developed because of that... In .NET as I noted already in another thread here for enterprise level apps and small businesses custom apps when programming against backend DBs are that MS Access or MS SQL ones - you usually need just a few - I'd count less than ten classes and methods of ADO.NET. Yes, I understand in your framework you make many run-time dynamic SQL-scripts generation - you will not need that in .NET - but if you'll need you can use NHibernate for dynamic objects/SQL or many code generation tools for static objects/SQL generation etc. - and I'd rely solely on ADO.NET Entity Framework starting .NET Framework v.4.0 ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 5:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com <<< snipped >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From dwaters at usinternet.com Fri Oct 16 09:09:59 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 09:09:59 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Oct 16 11:00:26 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 09:00:26 -0700 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: Just be aware that conversion tools do splendidly if what they're converting is fairly straight-forward objects and code. They fall in a heap over complex subforms and subreports. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 7:10 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 16 12:56:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 21:56:52 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 13:27:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 14:27:05 -0400 Subject: [dba-VB] Threads and stuff Message-ID: <4AD8BAF9.4070304@colbyconsulting.com> I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Oct 16 15:00:20 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 13:00:20 -0700 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: Are you declaring the properties shared? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 11:27 AM To: VBA Subject: [dba-VB] Threads and stuff I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 16 15:06:16 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 15:06:16 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 16 15:33:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 16:33:05 -0400 Subject: [dba-VB] Threads and stuff In-Reply-To: References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <4AD8D881.8050103@colbyconsulting.com> Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 15:40:12 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Oct 2009 00:40:12 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: <008a01ca4ea0$ddae6c10$990b4430$@spb.ru> Hi Dan, OK, that sounds good - a good candidate application for automated conversion I mean :) 50KB of code isn't that much to clean-up after automated conversion but it's important to know what this code does? For example, once in the very beginning of my .NET development practice I have got converted advanced MS Excel VB6 COM add-in with about 10,000-15,000(?) code lines into VB.NET COM add-in - conversion of VB6 code into VB.NET is a built-in feature of Visual Studio but after that conversion I have spent about three days to make the converted code up & running, and I have got all that add-in functionality working OK. That add-in code didn't use database and if your code is like that - i.e. it is mainly utility/business layer functionality without that much db communication and without a lot of built-in SQL then clean-up of 50KB of code lines after automatic conversion could be done in max. 15 days. You can try to use the tools you mentioned with Northwind db - and I (and maybe somebody else also here) can have a look on the results of automatic conversion, and then we can tell more clearly how good this automatic conversion is. I'd note that the companies who sell such conversion tools do usually have rather limited evaluation versions - if such evaluation version will not be able to process NorthWind sample app (do they have it already processed as sa ample?) maybe you can contact them directly and ask to run the full version against Northwind and send you the converted result for evaluation. It's not an issue IMO for evaluation that converted app will have MS Access BE because the main part of work of your app conversion is currently expected to be forms/reports + code conversion... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Saturday, October 17, 2009 12:06 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From michael at ddisolutions.com.au Sun Oct 18 17:47:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 19 Oct 2009 09:47:17 +1100 Subject: [dba-VB] Threads and stuff References: <4AD8BAF9.4070304@colbyconsulting.com> <4AD8D881.8050103@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01582518@ddi-01.DDI.local> Hi John, I havn't delved deeply into the threading model in .net. I have used the background worker object from time to time though. The way that works is using events to pass data to and from your threaded class. It's always worked well for my modest needs. That said, will the 'volatile' keyword help you? Cheers Michael M Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Oct 19 00:44:23 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Oct 2009 09:44:23 +0400 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <00d601ca507f$38e682e0$aab388a0$@spb.ru> <<< Anyway, because the class method that the thread runs has to be static >>> Hi John, Threads can run on instance methods - here is just a quick sample - no static methods used at all except console app's entry method: using System; using System.Threading; namespace ConsoleApplication1 { public class ThreadRunner { private int _threadNum; public ThreadRunner(int threadNum) { _threadNum = threadNum; } public void Run() { Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} started, Id = {2}", DateTime.Now, _threadNum, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(1100 - _threadNum*100 ); Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} finished.", DateTime.Now, _threadNum); } } public class ThreadManager { public void StartThreads() { for (int i = 1; i<=10; i++) { Thread th = new Thread(RunThread); th.Start(new ThreadRunner(i)); } } public void RunThread(object threadRunner) { ThreadRunner tr = (ThreadRunner)threadRunner; tr.Run(); } } class Program { static void Main(string[] args) { (new ThreadManager()).StartThreads(); } } } Here is output this sample produces: 09:41.53.519: Thread#3 started, Id = 5 09:41.53.519: Thread#1 started, Id = 3 09:41.53.522: Thread#4 started, Id = 6 09:41.53.524: Thread#5 started, Id = 7 09:41.53.520: Thread#2 started, Id = 4 09:41.53.524: Thread#6 started, Id = 8 09:41.53.524: Thread#7 started, Id = 9 09:41.53.524: Thread#8 started, Id = 10 09:41.53.524: Thread#9 started, Id = 11 09:41.53.524: Thread#10 started, Id = 12 09:41.53.625: Thread#10 finished. 09:41.53.724: Thread#9 finished. 09:41.53.824: Thread#8 finished. 09:41.53.924: Thread#7 finished. 09:41.54.024: Thread#6 finished. 09:41.54.124: Thread#5 finished. 09:41.54.223: Thread#4 finished. 09:41.54.323: Thread#3 finished. 09:41.54.424: Thread#2 finished. 09:41.54.523: Thread#1 finished. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 10:27 PM To: VBA Subject: [dba-VB] Threads and stuff .... Anyway, because the class method that the thread runs has to be static ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4520 (20091018) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Oct 19 05:13:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 19 Oct 2009 12:13:46 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil My contact has been on vacation. He'll forward me some info later today which I will forward to you off-line. He confirms that hosting, indeed traffic, may be quite expensive in Russia. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From raibeart at gmail.com Mon Oct 19 20:31:00 2009 From: raibeart at gmail.com (Robert Stewart) Date: Mon, 19 Oct 2009 20:31:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <4add12d6.0ac0100a.3a77.520b@mx.google.com> From what I am reading, Access Whiz Options: First Option Price Bundle Price A- Access to VB .NET (Web Application): ANETVB $169.00 $60.00 B- Access to VB .NET (Windows Application): ANETVB8 $169.00 $60.00 C- Access to VB6 (Windows Application): AccessToVB6 $94.00 $40.00 D- Access to C# (Web Application) ANETVC $169.00 $60.00 E- Access to Crystal Reports 8 or later: AccessToCR $169.00 $60.00 F- Access Form Controls to VB .NET: ANETVBF $45.00 $25.00 G- Access Form Controls to C# .NET: ANETVCF $45.00 $25.00 H- Access to C# (Windows Application): ANETVC7 $169.00 $60.00 Looks like it would cost me: D - $169 E - $ 60 G - $ 25 ______ $254 To be able to do a complete conversion, plus the cost of Crystal. On the second one, the link is broken to the 2003 databases, and it only converts to VB6. I think they are a bit too far behind the times to be very useful. I will take a look at the first one and let the list know back what I think about it. I think my code is pretty good and standard. So, it should not be that difficult for the program to convert it to C#. I have a project about double the size of yours to convert to ASP.net. So a tool like this might be very useful. In looking at the download page when they send it to you, System Requirements Supported Operating Systems: Windows 2000; Windows Server 2003; Windows Server 2008; Windows Vista; Windows XP Required Software: Access 2000 or later; Full version of Crystal Reports RDC, Report Designer Component 8 or later is required for AccessToCR, Access Whiz Option E; Microsoft .NET Framework SDK 1.x or 2.0 is required for Access Whiz Options A, B, D, F, G and H Display: 1024 x 768 high color I am not sure how helpful .Net 2.0 is going to be when I am doing everything in 3.5 SP1. Also, notice that The full version of Crystal Reports RDC is required to do the report conversions. You might also want to take a look at their FAQ page. There seems to be a lot it does not do. At 12:00 PM 10/16/2009, you wrote: >Date: Fri, 16 Oct 2009 09:09:59 -0500 >From: "Dan Waters" >Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? >To: "'Discussion concerning Visual Basic and related programming > issues.'" >Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD at danwaters> >Content-Type: text/plain; charset="iso-8859-1" > >Hi Shamil, > >This is exactly what I was hoping would be available! Great! > >I have a direct conversion project with 175 forms/reports. Most are simple >but some are complex. I also have 89 standard modules/class modules. SQL >Server 2005 will contain the BE. So, this is a lot of work. > >I did find 2 software utility tools which will do conversion of objects in >Access to objects in VB.Net. > > 1) http://www.microtools.us/ this is $160. > 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. > >If either even works fairly well, that would be the way to go. > >These both have demo versions so if someone wants to try them out and report >back that would be helpful. I don't know enough of VB.Net yet to make a >good assessment. > >Thanks! >Dan From jwcolby at colbyconsulting.com Tue Oct 20 10:45:20 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 11:45:20 -0400 Subject: [dba-VB] C# replace a special character Message-ID: <4ADDDB10.4010703@colbyconsulting.com> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Oct 20 11:21:32 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 20 Oct 2009 18:21:32 +0200 Subject: [dba-VB] C# replace a special character Message-ID: Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From drawbridgej at sympatico.ca Tue Oct 20 11:27:20 2009 From: drawbridgej at sympatico.ca (Jack and Pat) Date: Tue, 20 Oct 2009 12:27:20 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 20 11:33:44 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:33:44 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: I think the overhead of RegEx would be too high on a really large replace. It works great, but it isn't the fastest way. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Tue Oct 20 11:34:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:34:42 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Except the for the semicolon, that's the way to do it in VB.Net too. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 20, 2009 9:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav From marklbreen at gmail.com Tue Oct 20 12:39:06 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 20 Oct 2009 18:39:06 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Hello John, I used the following SQL today, and it works a treat, in my case, I wanted to exclude all except alphas, I know that it is not C#, and I know you may prefer C# as practice, so if it is no useful, just bin it. I got the code from this site, if you have a look, there is a little more there that you may be able to make use of. Thanks to Nigel Rivett. http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html WHILE @@rowcount > 0 UPDATE tablename SET columnname = REPLACE(columnname, SUBSTRING(columnname, PATINDEX('%[^a-zA-Z0-9]%', columnname), 1), '') WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 Mark 2009/10/20 Charlotte Foust > Except the for the semicolon, that's the way to do it in VB.Net too. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Tuesday, October 20, 2009 9:22 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] C# replace a special character > > Hi John > > You should be able to use the Replace method directly on your string > holding the line or the file: > > theStringToCleanUp.Replace(((char)26).ToString(),""); > > like: > > string contents = File.ReadAllText(path); > File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Tue Oct 20 12:47:02 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 10:47:02 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Just a minor note: Even in that small piece of code there is an error. It reads: string output = Regex.Replace(input, "N.t", "NET"); ...but it should read: string output = Regex.Replace(input, "Not", "NET"); Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Tue Oct 20 12:54:31 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 18:54:31 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: <4addf97f.0c11660a.320f.1168@mx.google.com> Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Tue Oct 20 13:10:50 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:10:50 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Message-ID: <9347022991EF4B13A31B779024041F56@creativesystemdesigns.com> I have no idea how fast this 'search and replace' product is but according to a friend, it is a great little product for searching non indexed hard drives... far faster than Windows own indexing, according to him. http://www.inforapid.de/html/searchreplace.htm HTH Jim From accessd at shaw.ca Tue Oct 20 13:29:11 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:29:11 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4addf97f.0c11660a.320f.1168@mx.google.com> References: <4addf97f.0c11660a.320f.1168@mx.google.com> Message-ID: <17B53F39615F4A1BB67C69C33BE5CBB3@creativesystemdesigns.com> STREAMING would be even faster... I switched some ADO code from CHUNK picture data retrieval to ADO to Stream, a number of years ago, on a project and the transfer rate was on an order of magnitude faster. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 20, 2009 10:55 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 20 14:49:26 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 Oct 2009 23:49:26 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Hi John, Try this code snippet changing input and output files' paths: int bufferSize = 1024*1024; string inputFile = @"c:\temp\inputFile.txt"; string outputFile = @"c:\temp\outputFile.txt"; System.IO.FileStream inputStream = new System.IO.FileStream( inputFile, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None, bufferSize); System.IO.FileStream outputStream = new System.IO.FileStream( outputFile, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None, bufferSize); byte[]data = new byte[bufferSize]; int offset = 0; int totalLength = 0; int length = 0; while ((length = inputStream.Read(data, offset, bufferSize)) > 0) { totalLength += length; string text = System.Text.Encoding.ASCII.GetString(data); text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; data = System.Text.Encoding.ASCII.GetBytes(text); outputStream.Write(data, offset, length); } inputStream.Close(); outputStream.Close(); Console.WriteLine("Total length test: {0}", totalLength); HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 7:45 PM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Tue Oct 20 14:53:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:53:22 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <4ADE1532.2000109@colbyconsulting.com> It is my guess that Regex will be too slow. This will be a file with about 100 characters average per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but reading in 200 million bytes all at once could cause issues. John W. Colby www.ColbyConsulting.com Jack and Pat wrote: > John, > > I did a google search to find this link. I'm not a C# person, but thought > I'd pass this on > > http://dotnetperls.com/regex-replace-1 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 11:45 AM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From jwcolby at colbyconsulting.com Tue Oct 20 14:56:33 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:56:33 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADE15F1.1050803@colbyconsulting.com> Thanks Mark. Doing it inside SQL Server is the ideal for sure. ATM I only have the issue in the Address field of the typical FName, LName, Addr, City, St, Zip5, Zip4 record. Thinking about it though you could conceivably have this issue in any field. I will definitely check this out though. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 20 15:00:53 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 16:00:53 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com> <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Message-ID: <4ADE16F5.6030600@colbyconsulting.com> Thanks Shamil! John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Try this code snippet changing input and output files' paths: > > int bufferSize = 1024*1024; > > string inputFile = @"c:\temp\inputFile.txt"; > string outputFile = @"c:\temp\outputFile.txt"; > > System.IO.FileStream inputStream = > new System.IO.FileStream( > inputFile, > System.IO.FileMode.Open, > System.IO.FileAccess.Read, > System.IO.FileShare.None, > bufferSize); > System.IO.FileStream outputStream = > new System.IO.FileStream( > outputFile, > System.IO.FileMode.Create, > System.IO.FileAccess.Write, > System.IO.FileShare.None, > bufferSize); > > byte[]data = new byte[bufferSize]; > int offset = 0; > int totalLength = 0; > int length = 0; > while ((length = inputStream.Read(data, offset, bufferSize)) > 0) > { > totalLength += length; > > string text = System.Text.Encoding.ASCII.GetString(data); > text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; > data = System.Text.Encoding.ASCII.GetBytes(text); > > outputStream.Write(data, offset, length); > } > > inputStream.Close(); > outputStream.Close(); > > Console.WriteLine("Total length test: {0}", totalLength); > > HTH. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 7:45 PM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From stuart at lexacorp.com.pg Tue Oct 20 16:28:39 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 21 Oct 2009 07:28:39 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE1532.2000109@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP>, <4ADE1532.2000109@colbyconsulting.com> Message-ID: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> 200 megabytes tirivial. I just knocked this up in PowerBasic (this is the complete program!): #COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG LOCAL strFile AS STRING LOCAL lngSTart AS LONG LOCAL strData AS STRING strFile = "ML_Data.mdb" lngStart = TIMER OPEN strFile FOR BINARY AS #1 GET$ #1, LOF(1), strData CLOSE #1 REPLACE "A" WITH "B" IN strData OPEN strfile & "fixed" FOR BINARY as#1 PUT$ #1, strData CLOSE #1 MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" END FUNCTION It compiles to an 11KB executable with no dependencies. It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of that time was taken in reading and writing the file to/from memory. -- Stuart On 20 Oct 2009 at 15:53, jwcolby wrote: > It is my guess that Regex will be too slow. This will be a file with about 100 characters average > per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but > reading in 200 million bytes all at once could cause issues. > > John W. Colby > www.ColbyConsulting.com > > > Jack and Pat wrote: > > John, > > > > I did a google search to find this link. I'm not a C# person, but thought > > I'd pass this on > > > > http://dotnetperls.com/regex-replace-1 > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Tuesday, October 20, 2009 11:45 AM > > To: VBA > > Subject: [dba-VB] C# replace a special character > > > > I have a file which contains a sprinkling of a special character - decimal > > 26, hex 1A (the SUB > > character). This special character in the CSV file output to Accuzip causes > > Accuzip to hiccup. In > > order to get on with my life I need to pre-process the files to get rid of > > this special character. > > Because of the size of these files (hundreds of mbytes) I need to do a > > readline / replace / > > writeline kind of thing. I think I need to use the stringbuilder.replace > > but I do not know how to > > specify replacing this hex 1A with something else. The something else would > > ideally be nothing > > (empty string) but can be any valid alpha character (A, B etc). > > > > Can anyone help me with this replace part of the problem. C# syntax please. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From max.wanadoo at gmail.com Tue Oct 20 17:12:19 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 23:12:19 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: What if the input line wont fit into memory? max On 20/10/2009, Stuart McLachlan wrote: > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > >> It is my guess that Regex will be too slow. This will be a file with >> about 100 characters average >> per line, 2 million lines. Doing this in one big read MIGHT be possible >> (and I will try) but >> reading in 200 million bytes all at once could cause issues. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Jack and Pat wrote: >> > John, >> > >> > I did a google search to find this link. I'm not a C# person, but >> > thought >> > I'd pass this on >> > >> > http://dotnetperls.com/regex-replace-1 >> > >> > -----Original Message----- >> > From: dba-vb-bounces at databaseadvisors.com >> > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> > Sent: Tuesday, October 20, 2009 11:45 AM >> > To: VBA >> > Subject: [dba-VB] C# replace a special character >> > >> > I have a file which contains a sprinkling of a special character - >> > decimal >> > 26, hex 1A (the SUB >> > character). This special character in the CSV file output to Accuzip >> > causes >> > Accuzip to hiccup. In >> > order to get on with my life I need to pre-process the files to get rid >> > of >> > this special character. >> > Because of the size of these files (hundreds of mbytes) I need to do a >> > readline / replace / >> > writeline kind of thing. I think I need to use the >> > stringbuilder.replace >> > but I do not know how to >> > specify replacing this hex 1A with something else. The something else >> > would >> > ideally be nothing >> > (empty string) but can be any valid alpha character (A, B etc). >> > >> > Can anyone help me with this replace part of the problem. C# syntax >> > please. >> > >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 21 08:56:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 09:56:21 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF1305.1090809@colbyconsulting.com> Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Jay.Hunnicutt at med.navy.mil Wed Oct 21 09:25:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 10:25:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF1305.1090809@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: John, If you make it a SQL Scalar function you can use it to strip characters for select, Update and insert statements as needed. Makes it a little easier to use as well as reusable. CREATE FUNCTION F_DropSpecChar ( -- Add the parameters for the function here @S varchar(100) ) RETURNS varchar(100) AS BEGIN -- Declare the return variable here DECLARE @Result varchar(100) DECLARE @i INTEGER select @i = patindex('%[^a-zA-Z0-9 ]%', @s) while @i > 0 begin select @s = replace(@s, substring(@s, @i, 1), '') select @i = patindex('%[^a-zA-Z0-9 ]%', @s) end SELECT @Result = @S -- Return the result of the function RETURN @Result END GO Query: select dbo.F_DropSpecChar('qh*(*^&$^1234') Returns: qh1234 Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 9:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I > wanted to exclude all except alphas, I know that it is not C#, and I > know you may prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little > more there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >> Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); File.WriteAllText(path, >> contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:09:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:09:22 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: <4ADF2422.7060204@colbyconsulting.com> I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes it > a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Oct 21 10:23:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:23:43 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF277F.60802@colbyconsulting.com> Mark, Below is the SP I created to perform this magic. I will be running this on 66 million records so we shall see about performance. set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: -- Create date: -- Description: -- --WHILE @@rowcount > 0 -- UPDATE tablename -- SET columnname = REPLACE(columnname, -- SUBSTRING(columnname, -- PATINDEX('%[^a-zA-Z0-9]%', -- columnname), 1), '') -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 -- -- ============================================= ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] -- Add the parameters for the stored procedure here @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @SQL varchar(1000) declare @PatIndex varchar(50) BEGIN TRY set @PatIndex = '%[^a-zA-Z0-9 .,#]%' SELECT @SQL = 'WHILE @@rowcount > 0 UPDATE ' + @DBName + '.dbo.' + @TblName + ' SET ' + @FldName + ' = REPLACE(' + @FldName + ', SUBSTRING(' + @FldName + ', PATINDEX(''' + @PatIndex + ''', ' + @FldName + '), 1), '''') WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' exec (@SQL) print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName END TRY BEGIN CATCH print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName print @SQL print ERROR_MESSAGE() END CATCH END John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark From Jay.Hunnicutt at med.navy.mil Wed Oct 21 10:28:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 11:28:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2422.7060204@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: John, Just add the comma into the accepted characters like patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces and the spaces are left in the return as they are not a part of the condition. Query: select dbo.F_DropSpecChar('abc fge, 123, NC') Returns: abc fge, 123, NC Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 11:09 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes > it a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:46:47 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:46:47 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: <4ADF2CE7.4050902@colbyconsulting.com> Jay, Thanks for that. I figured it out, added the special characters that I need and tested it and it is working great. And pretty darned fast IMHO. I did a replace on one field, 62.8 million records, 2:52 (three minutes). Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores assigned to SQL Server. John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > Just add the comma into the accepted characters like > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > and the spaces are left in the return as they are not a part of the > condition. > > Query: > select dbo.F_DropSpecChar('abc fge, 123, NC') > > Returns: > > abc fge, 123, NC > > Jay Hunnicutt From jwcolby at colbyconsulting.com Wed Oct 21 10:47:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:47:13 -0400 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF277F.60802@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> Message-ID: <4ADF2D01.9000308@colbyconsulting.com> Just an FYI, I ran this against 1 million records, in a query that pulled the top(1000000) City fields (where this specific problem lies) and it took about 13 seconds. This is with an index in place that includes the city field. I then ran it against the entire table (62.8 million records) and it took 2 minutes 52 seconds. This will become a standard part of my program for cleaning up my data. Thanks Mark Breen! John W. Colby www.ColbyConsulting.com jwcolby wrote: > Mark, > > Below is the SP I created to perform this magic. I will be running this on 66 million records so we > shall see about performance. > > set ANSI_NULLS ON > set QUOTED_IDENTIFIER ON > go > > -- ============================================= > -- Author: > -- Create date: > -- Description: > -- > --WHILE @@rowcount > 0 > -- UPDATE tablename > -- SET columnname = REPLACE(columnname, > -- SUBSTRING(columnname, > -- PATINDEX('%[^a-zA-Z0-9]%', > -- columnname), 1), '') > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > -- > -- ============================================= > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > -- Add the parameters for the stored procedure here > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > AS > BEGIN > -- SET NOCOUNT ON added to prevent extra result sets from > -- interfering with SELECT statements. > SET NOCOUNT ON; > declare @SQL varchar(1000) > declare @PatIndex varchar(50) > > BEGIN TRY > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > SELECT @SQL = 'WHILE @@rowcount > 0 > UPDATE ' + @DBName + '.dbo.' + @TblName + ' > SET ' + @FldName + ' = REPLACE(' + @FldName + ', > SUBSTRING(' + @FldName + ', > PATINDEX(''' + @PatIndex + ''', > ' + @FldName + '), 1), '''') > WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' > exec (@SQL) > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > END TRY > BEGIN CATCH > print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > print @SQL > print ERROR_MESSAGE() > END CATCH > END > > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I wanted >> to exclude all except alphas, I know that it is not C#, and I know you may >> prefer C# as practice, so if it is no useful, just bin it. >> >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> PATINDEX('%[^a-zA-Z0-9]%', >> columnname), 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:27:36 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:27:36 +0100 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2CE7.4050902@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> <4ADF2CE7.4050902@colbyconsulting.com> Message-ID: Hello John, As they say, when you only have a hammer, everything looks like a nail. My hammer is my SQL Skills, and I know that I sometimes use them where C# would be more appropriate, I see from Shamils code how easy it is in .Net also, anyway, we all have the options now of c#, PB and TSQL. Glad it worked, thanks Mark 2009/10/21 jwcolby > Jay, > > Thanks for that. I figured it out, added the special characters that I > need and tested it and it is > working great. And pretty darned fast IMHO. I did a replace on one field, > 62.8 million records, > 2:52 (three minutes). > > Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores > assigned to SQL Server. > > John W. Colby > www.ColbyConsulting.com > > > Hunnicutt, Jay E. (Civ) wrote: > > John, > > Just add the comma into the accepted characters like > > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > > and the spaces are left in the return as they are not a part of the > > condition. > > > > Query: > > select dbo.F_DropSpecChar('abc fge, 123, NC') > > > > Returns: > > > > abc fge, 123, NC > > > > Jay Hunnicutt > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:29:54 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:29:54 +0100 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF2D01.9000308@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> <4ADF2D01.9000308@colbyconsulting.com> Message-ID: Hello John, thanks for the credit, but the real credit goes to Nigel Rivett. But thanks anyway Have a nice weekend, Mark Mark Breen said >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> 2009/10/21 jwcolby > Just an FYI, I ran this against 1 million records, in a query that pulled > the top(1000000) City > fields (where this specific problem lies) and it took about 13 seconds. > This is with an index in > place that includes the city field. I then ran it against the entire table > (62.8 million records) > and it took 2 minutes 52 seconds. > > This will become a standard part of my program for cleaning up my data. > > Thanks Mark Breen! > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: > > Mark, > > > > Below is the SP I created to perform this magic. I will be running this > on 66 million records so we > > shall see about performance. > > > > set ANSI_NULLS ON > > set QUOTED_IDENTIFIER ON > > go > > > > -- ============================================= > > -- Author: > > -- Create date: > > -- Description: > > -- > > --WHILE @@rowcount > 0 > > -- UPDATE tablename > > -- SET columnname = REPLACE(columnname, > > -- SUBSTRING(columnname, > > -- > PATINDEX('%[^a-zA-Z0-9]%', > > -- columnname), 1), > '') > > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > -- > > -- ============================================= > > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > > -- Add the parameters for the stored procedure here > > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > > AS > > BEGIN > > -- SET NOCOUNT ON added to prevent extra result sets from > > -- interfering with SELECT statements. > > SET NOCOUNT ON; > > declare @SQL varchar(1000) > > declare @PatIndex varchar(50) > > > > BEGIN TRY > > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > > SELECT @SQL = 'WHILE @@rowcount > 0 > > UPDATE ' + @DBName + > '.dbo.' + @TblName + ' > > SET ' + @FldName + ' = > REPLACE(' + @FldName + ', > > SUBSTRING(' + @FldName + ', > > PATINDEX(''' + @PatIndex + > ''', > > ' + @FldName + > '), 1), '''') > > WHERE PATINDEX(''' + > @PatIndex + ''', ' + @FldName + ') <> 0' > > exec (@SQL) > > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + > @TblName + '.' + @FldName > > END TRY > > BEGIN CATCH > > print 'There was an error REPLACING CHARACTERS IN ' + > @DBName + '.' + @TblName + '.' + @FldName > > print @SQL > > print ERROR_MESSAGE() > > END CATCH > > END > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Mark Breen wrote: > >> Hello John, > >> I used the following SQL today, and it works a treat, in my case, I > wanted > >> to exclude all except alphas, I know that it is not C#, and I know you > may > >> prefer C# as practice, so if it is no useful, just bin it. > >> > >> I got the code from this site, if you have a look, there is a little > more > >> there that you may be able to make use of. > >> > >> Thanks to Nigel Rivett. > >> > >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > >> > >> > >> > >> WHILE @@rowcount > 0 > >> UPDATE tablename > >> SET columnname = REPLACE(columnname, > >> SUBSTRING(columnname, > >> PATINDEX('%[^a-zA-Z0-9]%', > >> columnname), 1), > '') > >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > >> > >> > >> > >> > >> Mark > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:31:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:31:16 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: Hello Stuart, Have not heard of PowerBasic since 2001, is is still in use? or is this an old language that you still use through familiarity? Thanks Mark 2009/10/20 Stuart McLachlan > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > It is my guess that Regex will be too slow. This will be a file with > about 100 characters average > > per line, 2 million lines. Doing this in one big read MIGHT be possible > (and I will try) but > > reading in 200 million bytes all at once could cause issues. > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Jack and Pat wrote: > > > John, > > > > > > I did a google search to find this link. I'm not a C# person, but > thought > > > I'd pass this on > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > To: VBA > > > Subject: [dba-VB] C# replace a special character > > > > > > I have a file which contains a sprinkling of a special character - > decimal > > > 26, hex 1A (the SUB > > > character). This special character in the CSV file output to Accuzip > causes > > > Accuzip to hiccup. In > > > order to get on with my life I need to pre-process the files to get rid > of > > > this special character. > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > readline / replace / > > > writeline kind of thing. I think I need to use the > stringbuilder.replace > > > but I do not know how to > > > specify replacing this hex 1A with something else. The something else > would > > > ideally be nothing > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > Can anyone help me with this replace part of the problem. C# syntax > please. > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 12:53:30 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 18:53:30 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Message-ID: Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark From accessd at shaw.ca Thu Oct 22 13:53:31 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 11:53:31 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Hi Mark: If you are setting up MySQL you should start thinking of using SPs. MySQL version 5 has this feature and pass-through queries in MSAccess, especially SELECT type queries are soooo slowwwwww. Check out the following: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, October 22, 2009 10:54 AM To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Oct 22 15:00:10 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 22 Oct 2009 21:00:10 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Mark, My friend gave me this answer - hope it helps I use the dreamweaver developer toolkit QUB it works exactly like access query's but it's web based and you need both dreamweaver and the developer toolkit to upload the files logon to the mysql then run a query. I've never found one better Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 22 October 2009 18:54 To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 15:57:31 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 06:57:31 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg>, Message-ID: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From accessd at shaw.ca Thu Oct 22 18:57:38 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 16:57:38 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> Message-ID: What sort of speed does PB get? Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, October 22, 2009 1:58 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 22:29:27 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 13:29:27 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, Message-ID: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > From max.wanadoo at gmail.com Fri Oct 23 01:58:47 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 07:58:47 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Message-ID: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> But what can you do with it? I cannot think of anything that I would want to do outside of Access...is that sad or what? Fast is good, but fast doing nothing is nothing. I can do nothing instantaneously! Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 04:29 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Fri Oct 23 05:48:50 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:48:50 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Fri Oct 23 05:54:52 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:54:52 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 08:12:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 14:12:33 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: <4ae1abd3.09c5660a.471e.ffff8b17@mx.google.com> Yes he would have to have dreamweaver installed Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 23 October 2009 11:49 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 09:01:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 10:01:54 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> Message-ID: <4AE1B752.7030306@colbyconsulting.com> > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max From max.wanadoo at gmail.com Fri Oct 23 09:05:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 15:05:33 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Yes, but I do all SQL stuff FROM access. I don't have the performance issues that you do (and I understand where you are at). So, what does PB do that I need to leave Access for? I can do ANYTHING from within Access (speed issues aside) Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 23 October 2009 15:02 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 23 10:01:33 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 23 Oct 2009 10:01:33 -0500 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:02 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 10:24:22 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 19:24:22 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Hi John, I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 6:02 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Oct 23 11:02:26 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 18:02:26 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From jwcolby at colbyconsulting.com Fri Oct 23 11:25:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 12:25:01 -0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Message-ID: <4AE1D8DD.6090103@colbyconsulting.com> Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil From cfoust at infostatsystems.com Fri Oct 23 11:36:18 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 09:36:18 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan From jwcolby at colbyconsulting.com Fri Oct 23 12:00:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 13:00:18 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1E122.1020902@colbyconsulting.com> > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The two > languages will get the missing features from the other and it will then > be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur > with VS 2010 or later. But after the change, using C# or VB.Net will be > just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 12:02:12 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 18:02:12 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1e1ad.170e660a.2cdd.4c8c@mx.google.com> Presumably then, a programmer could use "exactly" the same functionality to achieve "exactly" the same result but could use the language of their choice. Ie. "Good morning", "Guten Morgen" sounds the same to the person who "understands" the output? Ie, BuiltInFunction xyz() has same out put regardless of what constructs/coding was used within the function as long as writing it in BOTH languages achieved the same output. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 23 October 2009 17:36 To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: <000901ca5407$0963f350$1c2bd9f0$@spb.ru> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <000d01ca5407$0ad75970$20860c50$@spb.ru> Hi John, Thank you for your extended comment on "C# vs. native EXE." --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 8:25 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Fri Oct 23 12:51:43 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 10:51:43 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1E122.1020902@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: But I'm not looker for higher pay and higher mystique. I'm 65 and I don't want to program forever or be a consultant at all. VB.Net definitely can do some things C# can't, another reason I never saw much point in learning C# after I made the transition to .Net. We were mandated to use VB.Net because it would make the transition from Access faster. Fine by me. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 10:00 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] c# as a language of choice > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The > two languages will get the missing features from the other and it will > then be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will > be 'equalizing' C# and VB.Net. I don't remember if that's going to > occur with VS 2010 or later. But after the change, using C# or VB.Net > will be just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Oct 23 13:00:40 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 20:00:40 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From accessd at shaw.ca Fri Oct 23 13:09:58 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:09:58 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hi Mark: If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped using ODBC, except in extreme circumstances over 10 years ago and have never looked back. Back in 1997, a client did month end reports through MS Access to a MS SQL BE DB via a pass-through implementation. The report was done in two separate sections with each section taking 50 minutes before the report would start. They would do one report in the morning and one in the afternoon. The query was a 'Select * ..." type. When I converted their month-end report to ADO-OLE and used a SP. The results were that the entire report started in less than 2 seconds. See the sample code at: http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, October 23, 2009 3:55 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:19:10 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:19:10 -0700 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <711C50C13D994C65B774F500045A395D@creativesystemdesigns.com> The truth is that under .Net there is no performance advantage to using VB.Net or C#.Net or any other .Net flavour. Also, you can mix and match code extensions as long as they are not in the same module. The only advantage I can see is that C# sounds cooler... and we know real men and women only use 'C' or derivatives thereof. ;-) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:22:52 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:22:52 -0700 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: Ha ha ha... I guess the universal translator doesn't work... no wonder there are coding problems. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 11:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS2010: Dependency Injection (DI),The Microsoft Extensibility Framework (MEF) Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 13:37:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:37:09 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1F7D5.9020405@colbyconsulting.com> > Not long ago you were just starting to use SQL Server! So much to know, so little time. John W. Colby www.ColbyConsulting.com Dan Waters wrote: > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur with > VS 2010 or later. But after the change, using C# or VB.Net will be just a > syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 23, 2009 9:02 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# replace a special character > > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > That is sad indeed. Nice that you have so much Access work that you never > need to consider anything > else though. > > I have a ton of SQL Server work for one specific client. While I can and do > use Access to perform > this work it is not very efficient. My biggest issue is simply that Access > is single threaded so > when I start a long running stored procedure out on the server, Access comes > to a screeching halt. > > I have logging processes running in the code that executes these stored > procedures. So I time how > long, what the SP name is, what specific file is being created or loaded, > date / time that the step > occurred etc. When a SP starts to run, Access locks up. I cannot see the > status log (through the > Access FE) that tells me where I am in the process. > > As you can see, while Access does function, for this kind of thing it > functions poorly. > > Personally, for a variety of reasons I am moving to C#.Net for this kind of > development. C# is now > widely accepted as a valid language by my clients, it is extremely powerful, > and it is pretty darned > fast, though it will not be as fast as a native EXE. C# has a ton of > database stuff available to it > (though I am not there yet), it has multi-threading (though I am not there > yet), and on a Windows > environment it can do pretty much anything I can imagine doing (and I have a > very active > imagination). Additionally it can be used from right inside of SQL Server > (though I am not there yet). > > For me, C# makes a lot of sense. It has a steep learning curve though. If > it weren't for the fact > that I am a consultant first and foremost, I would go with VB.Net. I > "played" with VB.Net quite a > bit in the past and it was a bit easier to come up to speed on, and every > bit as powerful as C# > within the domain of problems I would ever attempt. > > However if I ever need to sell my .Net skills, C# is just an easier sell. > > John W. Colby > www.ColbyConsulting.com > > > Max Wanadoo wrote: >> But what can you do with it? >> >> I cannot think of anything that I would want to do outside of Access...is >> that sad or what? >> >> Fast is good, but fast doing nothing is nothing. >> >> I can do nothing instantaneously! >> >> Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Oct 23 13:39:48 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:39:48 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: <4AE1F874.1040805@colbyconsulting.com> >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw much > point in learning C# after I made the transition to .Net. We were > mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte From cfoust at infostatsystems.com Fri Oct 23 13:41:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 11:41:19 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1F874.1040805@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> <4AE1F874.1040805@colbyconsulting.com> Message-ID: Even with grown kids, I figure I'll be working the rest of my life too. Just not as a programmer, please. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 11:40 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# as a language of choice >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw > much point in learning C# after I made the transition to .Net. We > were mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Oct 23 16:06:11 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 24 Oct 2009 07:06:11 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Message-ID: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > From max.wanadoo at gmail.com Fri Oct 23 22:44:51 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Sat, 24 Oct 2009 04:44:51 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> Message-ID: <4ae27855.0a04d00a.69f3.ffffd6b8@mx.google.com> Thanks Stuart, I merely meant "from my perspective and from what I do". I am sure there are tons of stuff that other people need. I used to use QB some years back for "quick apps" and it was great. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 22:06 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Oct 24 05:19:17 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 14:19:17 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <000601ca5493$728c8d60$57a5a820$@spb.ru> Hi Dan, Go for C# - VB.NET is usually just 5%(?) closer than C# to "what folks already know" when learning .NET development after VBA/VB6 - spending just a few more time now to adapt to C# syntax you'll gain considerable advantage in long run. But I suppose that using C# from the very beginning will not force to spend more time on learning curve - the opposite is true - why? - keep reading this comment... ...as William noted myriad of times here - there are a lot of C# ready to use samples - that's a very important fact for learning curve and for real life development - despite the fact that there are automatic convertors from C# to VB.NET and vice versa they are not 100% correct but even if they would have been 99% correct you would have been losing time converting C# -> VB.NET and therefore losing advantage in competition with C# developers, and this competition is becoming more and more strict every day... ...using C# you also keep saving time as you do not need to type Function, Sub, Dim, As etc. - in long run that would be a good saving of your life time to be better spent with friends and family than with computers... ...etc... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 7:02 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4537 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Oct 24 10:26:13 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 19:26:13 +0400 Subject: [dba-VB] How to script MS SQL 2005 Database Objects using .NET... Message-ID: <000001ca54be$55977870$00c66950$@spb.ru> Hi All, I'm wondering how to perform the subject task? - similar to MS SQL Management Studio: {{Database}} -> Right-Click -> Tasks -> Generate Scripts.. Etc. I guess is should be possible to write custom code to get SQL DLL scripts for a given set of tables, their relationships and triggers? Is there a ready to use object model for such coding? Or one have to use system (extended) SPs? Or..? I wanted to automate this task. And I do not want to use third-party tools currently. Thank you. -- Shamil From marklbreen at gmail.com Mon Oct 26 02:24:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Oct 2009 07:24:14 +0000 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello All, In the past I found it a PITA to use MS Access as a SQL generator for SQL Server because Access / ODBC drivers applied a prefix of the Scheme name for all the tables - dbo_Customers. This meant that I could not build a query and then copy and paste the SQL unless I first renamed the tables, either manually or with code. However, I can let you know that with the ODBC Driver and the mySQL db that I hooked up to, the tables came with just their names - Customers, so I had a successful session on Friday showing my friend how to build queries. He was delighted, one query that takes three seconds used to take them three days in the past. Interestingly, I did some tests on performace of Linked tables compared to pass-through. The biggest query we ran was a six or seven table query that we saved and then ran a cross tab against that. It ran in 2 - 3 seconds, with all tables linked and no pass through used at all. I have to say in that case, or in similar examples it is not worth while running it as pass-through. I know that in certain cases PST will be faster, but I could not demonstrate a practical example on Friday. I know the benefits, so I am not trying to persuade anyone here, but I am just noting that you may find it is not worth jumping through hoops for PST until you know you need it. Thanks to all, Mark 2009/10/23 Jim Lawrence > Hi Mark: > > If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped > using ODBC, except in extreme circumstances over 10 years ago and have > never > looked back. > > Back in 1997, a client did month end reports through MS Access to a MS SQL > BE DB via a pass-through implementation. The report was done in two > separate > sections with each section taking 50 minutes before the report would start. > They would do one report in the morning and one in the afternoon. The query > was a 'Select * ..." type. > > When I converted their month-end report to ADO-OLE and used a SP. The > results were that the entire report started in less than 2 seconds. See the > sample code at: > > > http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo > rts.asp > > HTH > Jim > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Friday, October 23, 2009 3:55 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello Jim, > thanks for that, yes, I will train him on the benefits of utilising the > Client - Server aspect of the db, > > Just curious though, if I want to return all rows from the web based > hosting > centre, and I have to choices of > a) Select * from Customers ran as a PST query or > b) usp_GetAllCustomers ran as a PST query or > c) Select * from Customers ran as a linked table in Access > > do you think that there would be any noticeable performance difference, my > instinct would be that there would be none. > > Of course if there was a million orders and we wanted to sum all orders > where customer id = 22124, that would have to be better as Pass Through, > but > I would assume minor differences between an sproc and simply including all > the SQL within the PST query. We would loose the precomplile but from a > data and query perspective, I would expect similar (1-2 seconds) > performance. > > Thanks > > Mark > > > > > 2009/10/22 Jim Lawrence > > > Hi Mark: > > > > If you are setting up MySQL you should start thinking of using SPs. MySQL > > version 5 has this feature and pass-through queries in MSAccess, > especially > > SELECT type queries are soooo slowwwwww. > > > > Check out the following: > > > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > > > HTH > > Jim > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > > Sent: Thursday, October 22, 2009 10:54 AM > > To: Discussion of Hardware and Software issues; Discussion concerning > > Visual > > Basic and related programming issues. > > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > > > Hello All, > > I have to assist a friend tomorrow in connecting to a mySQL database and > > starting to build some queries. > > > > I intend to show him the differences between writing queries in MS Access > > when linked to mySQL, and using pass-through queries within Access. > > > > I will also be explaining the benefits of having a few views created > also. > > > > What I am looking for is a Windows based GUI tool that would connect to > > mySQL and allow him to build queries with click and drag like SSMS or > > Access > > does. > > > > This evening I have downloaded and installed two tools, one is the > default > > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > > initial looking anyway, to to allow me to drag a few fields from a table, > > but they do not seems to allow me to drag two or three tables and for the > > joins to be done in the GUI. > > > > Would anyone have any suggestions? > > > > TIA for your time, > > > > Mark > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Oct 26 07:51:17 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 08:51:17 -0400 Subject: [dba-VB] C# - How to access objects in inherited list Message-ID: <4AE59B45.7030003@colbyconsulting.com> Just to learn how, I am trying to subclass a generic list class. My grade calculator previously dimensioned a list and used it. The syntax to access objects in the list in that case was MyList{MyIndex]. In my class definition I subclassed my Grades to inherit the list class. class clsGrades: List { } Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the name of the list property that [] references? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Oct 26 08:13:24 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 09:13:24 -0400 Subject: [dba-VB] C# - How to access objects in inherited list In-Reply-To: <4AE59B45.7030003@colbyconsulting.com> References: <4AE59B45.7030003@colbyconsulting.com> Message-ID: <4AE5A074.50900@colbyconsulting.com> Well, I don't have a clue what I was doing before but this[] does work. My guess is that I was using This[] (capital T) instead of this[]. Anyway, I got it working. Sorry for the ring. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Just to learn how, I am trying to subclass a generic list class. > > My grade calculator previously dimensioned a list and used it. The syntax to access objects in the > list in that case was MyList{MyIndex]. > > In my class definition I subclassed my Grades to inherit the list class. > > class clsGrades: List > { > } > > Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the > life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the > name of the list property that [] references? > > TIA > From dwaters at usinternet.com Mon Oct 26 12:03:22 2009 From: dwaters at usinternet.com (Dan Waters) Date: Mon, 26 Oct 2009 12:03:22 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? Message-ID: Hello! I have some code from a forum that I believe may allow dragging a file to an Access for so that the file's full path can be captured by the form. If this can be done, then a file can be very easily 'attached' to an Access database. The code comes from here: http://bytes.com/topic/access/answers/197392-drag-drop The code was originally written by Felix Lima (MS Support Engineer), and posted by Stephen Lebans. I first tried putting this code into an mdb, but the database froze because the code that was waiting for a Windows Message ran continuously. So, I want to ask if someone can take this code and put it into a DLL file like Felix says it should be. I've put it all into a small Access file that I can send to you. If this works, I'll post a 'how to' in DB Advisors. Thanks! Dan From davidmcafee at gmail.com Mon Oct 26 12:11:52 2009 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 26 Oct 2009 10:11:52 -0700 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: Message-ID: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From DWUTKA at Marlow.com Tue Oct 27 12:05:18 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 27 Oct 2009 12:05:18 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Monday, October 26, 2009 12:12 PM To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 dwaters at usinternet.com Tue Oct 27 18:53:27 2009 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 27 Oct 2009 18:53:27 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew From michael at ddisolutions.com.au Tue Oct 27 19:03:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 28 Oct 2009 11:03:17 +1100 Subject: [dba-VB] Create a DLL for Access Drag Drop? References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015825AE@ddi-01.DDI.local> Hi Dan, In the dim dark past I think I did something like this. IIRC you supply the Data object (can be anything) in the StartDrag(?) event. I could be wrong... Cheers Michael Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Oct 28 15:29:26 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 28 Oct 2009 15:29:26 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Close your database, and reopen it. DO NOT go into any VBA code AT ALL. See if your procedure works. It probably should (though I haven't actually tried your code). The problem is that when ANY callback function runs, if the VBE has been opened, it will freak Access out like crazy! As for code to use a treeview: Option Compare Database Dim tvw As TreeView Private Sub Form_Load() Set tvw = Me.TreeView0.Object End Sub Private Sub Form_Unload(Cancel As Integer) Set tvw = Nothing End Sub Private Sub TreeView0_OLEDragDrop(Data As Object, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim nd As Node Select Case DetermineDropType(Data) Case "TEXT" Case "FILES" Case Else MsgBox "Invalid Object Type" End Select End Sub Function DetermineDropType(Data As Object) As String On Error Resume Next Dim strTemp As String strTemp = Data.GetData(1) If Not Err Then DetermineDropType = "TEXT" Exit Function End If Err.Clear If Data.Files.Count > 0 Then DetermineDropType = "FILES" End If End Function In the case 'FILES' you would use something like: For i=1 to Data.Files.Count strPath=DataFiles(i) 'do something with strpath Next i Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Tuesday, October 27, 2009 6:53 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or 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 Oct 1 14:47:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 15:47:08 -0400 Subject: [dba-VB] MySQL Message-ID: <4AC5073C.5050102@colbyconsulting.com> I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- John W. Colby www.ColbyConsulting.com From max.wanadoo at gmail.com Thu Oct 1 14:59:28 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 1 Oct 2009 20:59:28 +0100 Subject: [dba-VB] [AccessD] MySQL In-Reply-To: <4AC5073C.5050102@colbyconsulting.com> References: <4AC5073C.5050102@colbyconsulting.com> Message-ID: <4ac50a3a.0707d00a.659c.2f57@mx.google.com> No, but you might want to do it with Virtual Box (free from Sun). Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 01 October 2009 20:47 To: Access Developers discussion and problem solving; VBA Subject: [AccessD] MySQL I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- 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 Thu Oct 1 20:03:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 21:03:22 -0400 Subject: [dba-VB] SQL Server not locking up Message-ID: <4AC5515A.3070008@colbyconsulting.com> I am hesitantly declaring victory in the SQL Server war. I am going to award Nancy Lytle the award for the correct solution, with the proviso that she has to give it back if it turns out that the wily server misbehaves again. Since setting Max Degree of Parallelism to 3 I have not been locked out again. Understand that about this same time I also changed processor I/O affinity to only use the same three CPUs that I set CPU affinity for. And I have had so many problems with this, where it went away and then came back that I am very hesitant to declare victory but I did want to report back that the "locking up" issue hasn't recurred lately. Thanks go to everyone who volunteered suggestions. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 05:43:02 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 14:43:02 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: <002501ca4671$c8bfc420$5a3f4c60$@spb.ru> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From Gustav at cactus.dk Tue Oct 6 06:41:31 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Oct 2009 13:41:31 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Oct 6 07:37:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 Oct 2009 08:37:19 -0400 Subject: [dba-VB] Top 25 most dangerous programming errors Message-ID: <4ACB39FF.5030302@colbyconsulting.com> I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] Top 25 most dangerous programming errors In-Reply-To: <4ACB39FF.5030302@colbyconsulting.com> References: <4ACB39FF.5030302@colbyconsulting.com> Message-ID: <005e01ca46b3$6eccdb50$4c6691f0$@spb.ru> Hi John, Yes, that is a very useful site, thank you for sharing the link. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 06, 2009 4:37 PM To: Access Developers discussion and problem solving; VBA; Dba-Sqlserver Subject: [dba-VB] Top 25 most dangerous programming errors I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 13:45:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 19:45:00 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Message-ID: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 6 15:35:40 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 00:35:40 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Message-ID: <007701ca46c4$92e02d60$b8a08820$@spb.ru> Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 15:39:41 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 21:39:41 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <007701ca46c4$92e02d60$b8a08820$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> <007701ca46c4$92e02d60$b8a08820$@spb.ru> Message-ID: <4acbab22.0a1ad00a.7ab2.40ff@mx.google.com> I just saw the headlines on that link I sent you. You will have to read through what is on offer. They do all sorts of things on all sorts of platforms for all sorts of systems. It is really just a pick-and-mix for whatever you need. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 21:36 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Oct 7 07:53:48 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 14:53:48 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Wed Oct 7 08:31:08 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 17:31:08 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <009501ca4752$6f1073c0$4d315b40$@spb.ru> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 7 08:46:29 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 15:46:29 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil I believe they offer all of the three common scenarios: 1. Hosted in a shared environment (virtual) where you cannot install anything special 2. Hosting of a dedicated server provided by you or your client, installed as you like 3. Hosting of a dedicated server supplied by Verinet for your exclusive use, remotely installed by you I'll ask when my contact replies about your options. And yes, that is the exchange rate. /gustav >>> shamil at smsconsulting.spb.ru 07-10-2009 15:31 >>> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri Oct 9 11:24:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Oct 2009 12:24:52 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class Message-ID: <4ACF63D4.7090001@colbyconsulting.com> I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Oct 9 17:00:05 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 02:00:05 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4ACF63D4.7090001@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> Message-ID: <003601ca492b$dd700d50$985027f0$@spb.ru> Hi John, You can put your initialization code into your form constructor or Form_Load event processing method. BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP when programming on C# - and you'll feel a great relieve. Guaranteed/tested/proven by many developers. There are .NET natural naming conventions recommended by MS. Try to find and use them. Here is one source: http://www.irritatedvowel.com/Programming/Standards.aspx Here is a VS plug-in to help you get accustomed to the new naming conventions: http://www.codeplex.com/StyleCopForReSharper Although I haven't used it yet. --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 09, 2009 8:25 PM To: VBA Subject: [dba-VB] Error when passing controls to the constructor of a class I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Sat Oct 10 08:35:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 10 Oct 2009 09:35:01 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <003601ca492b$dd700d50$985027f0$@spb.ru> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> Message-ID: <4AD08D85.5030308@colbyconsulting.com> Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > From shamil at smsconsulting.spb.ru Sat Oct 10 11:18:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 20:18:53 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4AD08D85.5030308@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> <4AD08D85.5030308@colbyconsulting.com> Message-ID: <000601ca49c5$5dfbabc0$19f30340$@spb.ru> Hi John -- Yes, it works well for me - programming without Hungarian notation in .NET development - they say Hungarian is not needed because you can always use Intellisense to see the type of variables etc. I still use Hungarian notation sometimes in control names, and always when naming MS SQL views, SPs, UDFs, triggers... As for inconsistency in MS internal code - I suppose they can't quit Hungarian notation habits overnight - but they are moving in the new direction for sure... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, October 10, 2009 5:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Error when passing controls to the constructor of a class Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4495 (20091010) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Mon Oct 12 21:35:07 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 12 Oct 2009 22:35:07 -0400 Subject: [dba-VB] C# serialization Message-ID: <4AD3E75B.2070006@colbyconsulting.com> I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Oct 12 22:29:00 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 13 Oct 2009 14:29:00 +1100 Subject: [dba-VB] C# serialization References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015824EA@ddi-01.DDI.local> Hi John, I did this a few years ago and the project got canned so beware :-). It only works with a single class at a time IIRC. Maybe LINQ to XML might be the way to go for building nested related objects? Just struggling through some of this myself, but I'm working from existing XML data. Look at creating XML trees. http://msdn.microsoft.com/en-us/library/bb387068.aspx good luck Michael M using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.IO; using System.Xml.Serialization; /// /// Serializes and deserializes Layout objects /// public class Serializer { public Serializer( ) { } /// /// Serializes the Layout object /// /// /// public void SerializeNow( string filePath, T source, SerializationFormat format ) { if ( source == null ) throw new ArgumentNullException( "source", "Invalid object to serialize" ); if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format ) { case SerializationFormat.Xml: // Insert code to set properties and fields of the object. XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); // To write to a file, create a StreamWriter object. using ( StreamWriter myWriter = new StreamWriter( "PedalMap.xml" ) ) { mySerializer.Serialize( myWriter, source ); myWriter.Close( ); } break; case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.OpenOrCreate, FileAccess.Write ) ) { BinaryFormatter b = new BinaryFormatter( ); b.Serialize( fs, source ); } break; } } /// /// Deserializes the Layout object /// /// /// public T DeSerializeNow( string filePath, SerializationFormat format ) { if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format) { case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.Open, FileAccess.Read ) ) { BinaryFormatter b = new BinaryFormatter( ); try { return ( T ) b.Deserialize( fs ); } catch { return default( T ); } } case SerializationFormat.Xml: XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); using ( StreamReader myReader = new StreamReader( filePath ) ) return ( T ) mySerializer.Deserialize( myReader ); } return default( T ); } } The object to serialize, add the Serializable( ) attribute to the class. [Serializable( )] //Set this attribute to all the classes that want to serialize public class PedalMap { public PedalMap( ) { } //Add your properties here } You call it like so... Serializer s = new Serializer( ); s.SerializeNow( Application.ExecutablePath, _pmap, SerializationFormat.Xml ); -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 13 October 2009 1:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 13 09:54:36 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 07:54:36 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD3E75B.2070006@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: John, I'm not sure I understand what you're doing. Do these classes inherit typed datasets? If so, the parent class can easily return a child class that already contains a typed dataset of child records. You don't actually need collections for that. In that case, grade wouldn't need to be a class (although it could be, I just don't see any need). The Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, October 12, 2009 7:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Oct 13 10:37:59 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:37:59 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <4AD49ED7.5060300@colbyconsulting.com> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From cfoust at infostatsystems.com Tue Oct 13 10:39:40 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 08:39:40 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD49ED7.5060300@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: You can build a typed dataset on an xml file John. Doesn't require a database. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:38 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child > class that already contains a typed dataset of child records. You > don't actually need collections for that. In that case, grade > wouldn't need to be a class (although it could be, I just don't see > any need). The > > Charlotte Foust From Gustav at cactus.dk Tue Oct 13 10:57:22 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 17:57:22 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Sounds like a quite normal database app to me ... If so, all the typed dataset stuff is ready at your hands. To persist (to an XML file without the overhead you claim about) use method WriteXml. To read it at load, use method ReadXml. Can't be simpler. Of course, I can see an educational purpose by handcrafting a kind of database, but ... /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 10:59:49 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:59:49 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: <4AD4A3F5.5030509@colbyconsulting.com> That's nice Charlotte, but I assume that I would have to completely rewrite some level of how I do things. I would certainly welcome knowing how to do that but I don't want to do so at this moment. If this has anything to do with ADO and all of that stuff, I will be getting into that later. A year or so ago I used something similar to what I am doing now and just used serialization to write it out to a stream and later read it back in. I know from experience that once you are up to speed on the syntax of a language, it is easy to forget what a PITA all the nitpicking details are. I am still dealing with [] instead of () for the collections, explicit data type conversions and all the rest of the stuff that you don't even remember learning. "Building a typed dataset" of any kind is not where I am right now, never mind "on an XML file". Have patience Master. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > You can build a typed dataset on an xml file John. Doesn't require a > database. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 8:38 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply > input a list of grades. > There are three types of grades, each with a different weight (Tests - > 40% of grade, Labs - 50% of grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating > a total count of each grade type, sum of each type, average of each type > and weighted average of each type, and then the same calculations for > the totals. > > In order not to be bored to death, and with the approval of the > instructor, I expanded the assignment to include using classes and > collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) > which contains a generic collection into which the instances of clsGrade > are inserted. This collection is strongly typed so that it can only > accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in > clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or > "DL"). In the main form there is a combo with three grade type strings > ("Test", "Lab" and "DL") which when selected is passed in to > clsCalculator which indexes into the collection to access the correct > instance of clsGrades. Adding new grades, deleting grades and updating > existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection > holding three instances of... > clsGrades - contains a strongly typed generic collection holding > multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, > average and weighted average all of the grades contained within. > > clsCalculator requests the various computed values from the three > instances of clsGrades and performs the calculations to create an > overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), > Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, > then read it back in again. > Persist the grades to disk. I have no requirement to persist the data > to disk, I simply want to do so. > > Please please please do not suggest a "better way" for doing the > assignment, it is all written and functions exactly as you would expect > it to work. You may of course enlighten me on different options, but I > will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I > can persist it great, if not that's OK too. I have learned a lot and > thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a > "next semester" thing so I am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit > >> typed datasets? If so, the parent class can easily return a child >> class that already contains a typed dataset of child records. You >> don't actually need collections for that. In that case, grade >> wouldn't need to be a class (although it could be, I just don't see >> any need). The >> >> Charlotte Foust > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 13 11:13:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:13:13 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4A719.9090900@colbyconsulting.com> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Tue Oct 13 11:34:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 18:34:38 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 11:43:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:43:39 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4AE3B.1010205@colbyconsulting.com> I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at > typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at > that level. > > I am quite sure that in a year I will be throwing out typed datasets with the best of them but right > now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav From cfoust at infostatsystems.com Tue Oct 13 12:10:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 10:10:19 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4AE3B.1010205@colbyconsulting.com> References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: John, Typed datasets ARE serialized. That's the point. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 9:44 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to > LEARN C#. You do not start at typed data sets, you start with "this > is a variable" and "this is a for loop". I am very much at that level. > > I am quite sure that in a year I will be throwing out typed datasets > with the best of them but right now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Oct 13 13:19:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 14:19:30 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: <4AD4C4B2.9020600@colbyconsulting.com> Charlotte, No, the point is that datasets are over my head at this point in the journey. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > Typed datasets ARE serialized. That's the point. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 9:44 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > I am under the impression that you can write ANY repeating sequence such > as these grade classes to XML and read them back rather easily, using > serialization. However the only examples I am seeing are from back in > 100, 2002, 2004. A lot has happened since then, so I figured to get > modern examples of the same thing. Google is not being my friend ATM. > > As I said, I did this in VB, but cannot find my old code. > > I will certainly end up doing the database thing, but I want to get the > basic C# syntax down before I go there. I am still thumbing through my > book for the simplest little things. > > John W. Colby > www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 13 14:26:44 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 13 Oct 2009 23:26:44 +0400 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4A719.9090900@colbyconsulting.com> References: <4AD4A719.9090900@colbyconsulting.com> Message-ID: <003601ca4c3b$1a8cb190$4fa614b0$@spb.ru> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (part 1_ Message-ID: <004701ca4c41$9a7451a0$cf5cf4e0$@spb.ru> Hi John, The below approach and XmlArray attribute can be used for your sample/test case - the below posting didn't get dba-VB moderation on 20-SEP-09 : << Your mail to 'dba-VB' with the subject JSON and XML in memory serialization sample code Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 39406 bytes with a limit of 20 KB >> So I'm posting it here split into three parts: From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Sunday, September 20, 2009 6:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: JSON and XML in memory serialization sample code Hi All, Related to recent John post here (see P.S.) is a sample code of JSON and XML in memory serialization - how I do it usually. My question is do you know a way to implement XML in memory serialization using less code lines? I do use this XML code serialization for quite some time and I could have some new features, which could allow to simplify this code: Thank you. --Shamil P.S. Code sample - watch line wraps! - this code was nicely formatted here but when it will go through Internet it will get lines wrapped but anyway it should work - just edit comment lines and add references to System.Web and System.Web.Extensions assemblies: Continued in the next posting: From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 2) Message-ID: <004201ca4c41$992b56e0$cb8204a0$@spb.ru> Continued. using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; using System.Web.Script.Serialization; namespace ConsoleApplication1 { [XmlType("phoneBookEntry")] public class PhoneBookEntry { [XmlAttribute("firstName")] public string FirstName {get;set;} [XmlAttribute("lastName")] public string LastName { get; set; } [XmlAttribute("phoneName")] public string Phone { get; set; } } class Program { static void Main(string[] args) { PhoneBookEntry entry = new PhoneBookEntry(); entry.FirstName = "Peter"; entry.LastName = "Brown"; entry.Phone = "+7-921-1234567"; JavaScriptSerializer js = new JavaScriptSerializer(); string jsEntry = js.Serialize(entry); Console.WriteLine("1. JSON string\n{0}", jsEntry); PhoneBookEntry[] entries = { entry, entry, entry }; string jsEntries = js.Serialize(entries); Console.WriteLine("1. JSON array\n{0}", jsEntries); string xmlEntry = InMemoryObjectsSerializer.Serialize(entry); Console.WriteLine("1. XML string\n{0}", xmlEntry); string xmlEntries = InMemoryObjectsSerializer.Serialize(entries); Console.WriteLine("1. XML array\n{0}", xmlEntries); } } To be continued in part 3. From shamil at smsconsulting.spb.ru Tue Oct 13 15:17:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:17:52 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.2) Message-ID: <004c01ca4c42$3f63fb70$be2bf250$@spb.ru> Continued (from 3.1). /// /// In memory object data serialization /// public class InMemoryObjectsSerializer { /// /// Cconverts a custom object instance to XML string /// /// Object that is to be serialized to XML /// XML string in UTF8 format public static String Serialize(Object pObject) { String XmlizedString = null; MemoryStream memoryStream = new MemoryStream(); XmlSerializer xs = new XmlSerializer(typeof(T)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); xs.Serialize(xmlTextWriter, pObject); memoryStream = (MemoryStream)xmlTextWriter.BaseStream; XmlizedString = StringToBytes.UTF8ByteArrayToString(memoryStream.ToArray()); return XmlizedString; } /// /// Reconstruct an object instance from XML string /// /// Xml string to be used for object instance deserialization /// public static Object Deserialize(String pXmlizedString) { XmlSerializer xs = new XmlSerializer(typeof(T)); MemoryStream memoryStream = new MemoryStream(StringToBytes.StringToUTF8ByteArray(pXmlizedString)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); return xs.Deserialize(memoryStream); } } } From shamil at smsconsulting.spb.ru Tue Oct 13 15:20:31 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:20:31 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.1) Message-ID: <005601ca4c42$9dfc7180$d9f55480$@spb.ru> From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Wednesday, October 14, 2009 12:13 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: FW: JSON and XML in memory serialization sample code (Part 3) Continued from Part 2. /// /// Converts strings to byte arrays and vice versa /// public class StringToBytes { /// /// Converts a Byte Array of Unicode values (UTF-8 encoded) to a complete String. /// /// Unicode Byte Array to be converted to String /// String converted from Unicode Byte Array public static String UTF8ByteArrayToString(Byte[] characters) { UTF8Encoding encoding = new UTF8Encoding(); String constructedString = encoding.GetString(characters); return (constructedString); } /// /// Converts the String to UTF8 Byte array and is used in De serialization /// /// /// public static Byte[] StringToUTF8ByteArray(String pXmlString) { UTF8Encoding encoding = new UTF8Encoding(); Byte[] byteArray = encoding.GetBytes(pXmlString); return byteArray; } } To be continued in Part 3.2.. From Gustav at cactus.dk Tue Oct 13 16:25:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 23:25:35 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav From shamil at smsconsulting.spb.ru Tue Oct 13 17:28:47 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 02:28:47 +0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <005b01ca4c54$892d1f40$9b875dc0$@spb.ru> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 14, 2009 1:26 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# serialization Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 14 02:52:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 09:52:03 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks, I understand that now. /gustav >>> shamil at smsconsulting.spb.ru 14-10-2009 00:28 >>> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil From jwcolby at colbyconsulting.com Wed Oct 14 12:37:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 13:37:15 -0400 Subject: [dba-VB] Merge / Purge Message-ID: <4AD60C4B.2030706@colbyconsulting.com> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Oct 14 12:52:41 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 19:52:41 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John I would skip the update and delete parts as these are very slow. Instead, read/loop through the sorted table and append the single records to a new table. Thus: 1. Sort by name and "recenty" (what is the word for this, the most recent?) 2. Loop while collecting data for each name 3. For each name, append the collected and arranged data to the new (cleaned) table 4. Leave the old table as a backup I haven't worked with that many records so I cannot tell which coding method will turn out fastest. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Oct 14 13:05:50 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:05:50 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD612FE.5010107@colbyconsulting.com> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From Gustav at cactus.dk Wed Oct 14 13:19:23 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 20:19:23 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. From jwcolby at colbyconsulting.com Wed Oct 14 13:31:14 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:31:14 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD618F2.3080407@colbyconsulting.com> Further to this. I have a hash field which contains an SH1 hash for FName + LName + Addr + Zip5 + Zip4. These hash strings are absolutely unique (tested and confirmed) so what I am doing is pulling a view grouped by hash key where Count(PK) > 1. This gives me the data set of all hash keys of multiple ("dupes") records. In fact the hash key (and in fact all name / address fields) are out in a separate table related 1 to 1 with the fact table which I am "merging". Thus the hash would really pull a set of PKIDs which would be used to pull all of the fact records for the person that the hash key belongs to. Once those fact records are sitting in memory I would thing the update code would zip pretty well. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From jwcolby at colbyconsulting.com Wed Oct 14 13:39:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:39:10 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61ACE.6030707@colbyconsulting.com> You are right of course but I am thinking the update would just fly. There are about 550 fields in the fact table. Thus I would be comparing / updating 550 fields, sequentially, between Rec1 and Rec2. Then Rec2 / Rec3, Rec1 / Rec4 etc until all fact records for a given hash key (person) are finished. The "facts" can be anything from strings of 20-30 bytes down to a simple "Y". The vast majority of fields contain "Y" or nothing. A small minority contain codes ('A' - 'T') for example. And a very small number contain somewhat longer strings. This is not a transaction database so there will be no locking contentions etc. Just me and my update program whistling away. I will be working on a copy of the main table of course. Maybe writing modified (Record1) to one table and deleted (Records 2-N) to another table. At the end do the deletes / inserts. It probably will pay to copy all of the duplicate fact records out to a temp table and work on that as the source table. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 14 13:41:03 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:41:03 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61B3F.8000409@colbyconsulting.com> This is exactly the kind of stuff that I am taking my class for. C# is so much more faster / powerful than VBA in this kind of processing. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Wed Oct 14 14:51:07 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 15 Oct 2009 05:51:07 +1000 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD61B3F.8000409@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com> Message-ID: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> John, > >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > >> position, NOT date (I don't have date info). SQL Server doesn't have a concept of chronological record position. Unless there is atimestamp or incrementing field, there is no way to know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. Do use have an incrementing key field? Stuart McLachlan From jwcolby at colbyconsulting.com Wed Oct 14 15:19:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 16:19:54 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> References: , <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> Message-ID: <4AD6326A.4080708@colbyconsulting.com> Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. Unless there is > atimestamp or incrementing field, there is no way to know which is the most recent entry or > to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From cfoust at infostatsystems.com Wed Oct 14 16:20:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 14 Oct 2009 14:20:42 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6326A.4080708@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: Unless they have data in the same fields. Then what happens? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 14, 2009 1:20 PM To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Merge / Purge Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. >>>> "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent >>>> data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. > Unless there is atimestamp or incrementing field, there is no way to > know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 14 22:18:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 23:18:19 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: <4AD6947B.8090807@colbyconsulting.com> Charlotte, > Unless they have data in the same fields. Then what happens? Well, so what? Either overwrite or don't. Remember it is impossible to tell which is correct. They can't BOTH be correct. Flip a coin and do something, it literally doesn't matter what. John Colby Owns_A_Dog = 'Y' John Colby Owns_A_Dog = 'N' Which one is true? We have no way to say one record is more recent so flip a coin and merge the data. In fact in most cases (90% of all the fields) the data is "Y" or nothing. These records are the result of people taking polls. So in 90% of the cases, the person will answer "Y" or they have no answer because they weren't asked that question in that poll. The objective here is to get a ton of individual poll responses merged into a single record. I did a count earlier today and one person is in the database 36 times, 26 times, 17, 16, two 14s, four 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million total records). So when I try to ask the question "income bracket in (A-T)" and ("Owns a dog" OR "owns a cat") AND "mail order buyer", I end up with cases where "Owns a dog" was answered in one record and "mail order buyer" was answered in another record. So the AND fails whereas in fact the person answered affirmatively to both questions, just not in the same record. This is nuts. I need to merge things down so that there is a single record for a single person. ALL ANSWERS need to be in one record. If there are conflicting records, flip a coin, pick one answer. Now before you go off on normalization and a single column fact table, just remember that I have 50 million records X 550 columns. A single column fact table would end up with 25 Tera records and I don't have a supercomputer. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Unless they have data in the same fields. Then what happens? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 14, 2009 1:20 PM > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > related programming issues. > Subject: Re: [dba-VB] Merge / Purge > > Stuart, > > Yes there is a PKID. The thing is, every record is equal so it simply > doesn't matter in which order the records are pulled. Any of the > duplicates can be treated as the first record to be updated by whatever > is found in the subsequent records. > > It literally doesn't matter which record is encountered first. > > John W. Colby > www.ColbyConsulting.com From dbdoug at gmail.com Wed Oct 14 22:30:51 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 14 Oct 2009 20:30:51 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6947B.8090807@colbyconsulting.com> References: <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> <4AD6947B.8090807@colbyconsulting.com> Message-ID: <4dd71a0c0910142030vb19034fh7e316528476dcbca@mail.gmail.com> On Wed, Oct 14, 2009 at 8:18 PM, jwcolby wrote: > Charlotte, > > > Unless they have data in the same fields. Then what happens? > > Well, so what? Either overwrite or don't. Remember it is impossible to > tell which is correct. > They can't BOTH be correct. Flip a coin and do something, it literally > doesn't matter what. > > John Colby Owns_A_Dog = 'Y' > John Colby Owns_A_Dog = 'N' > > Which one is true? We have no way to say one record is more recent so flip > a coin and merge the data. > > In fact in most cases (90% of all the fields) the data is "Y" or nothing. > These records are the > result of people taking polls. So in 90% of the cases, the person will > answer "Y" or they have no > answer because they weren't asked that question in that poll. > > The objective here is to get a ton of individual poll responses merged into > a single record. I did > a count earlier today and one person is in the database 36 times, 26 times, > 17, 16, two 14s, four > 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million > total records). > > So when I try to ask the question "income bracket in (A-T)" and ("Owns a > dog" OR "owns a cat") AND > "mail order buyer", I end up with cases where "Owns a dog" was answered in > one record and "mail > order buyer" was answered in another record. So the AND fails whereas in > fact the person answered > affirmatively to both questions, just not in the same record. This is > nuts. I need to merge things > down so that there is a single record for a single person. ALL ANSWERS > need to be in one record. > If there are conflicting records, flip a coin, pick one answer. > > Now before you go off on normalization and a single column fact table, just > remember that I have 50 > million records X 550 columns. A single column fact table would end up > with 25 Tera records and I > don't have a supercomputer. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: > > Unless they have data in the same fields. Then what happens? > > > > Charlotte Foust > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Wednesday, October 14, 2009 1:20 PM > > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > > related programming issues. > > Subject: Re: [dba-VB] Merge / Purge > > > > Stuart, > > > > Yes there is a PKID. The thing is, every record is equal so it simply > > doesn't matter in which order the records are pulled. Any of the > > duplicates can be treated as the first record to be updated by whatever > > is found in the subsequent records. > > > > It literally doesn't matter which record is encountered first. > > > > John W. Colby > > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dwaters at usinternet.com Thu Oct 15 17:56:00 2009 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 15 Oct 2009 17:56:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Message-ID: I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan From shamil at smsconsulting.spb.ru Fri Oct 16 06:24:20 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 15:24:20 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 07:16:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 08:16:46 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <4AD8642E.6020103@colbyconsulting.com> It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Oct 16 07:26:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 16:26:53 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD8642E.6020103@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> Message-ID: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Hi John, Thank you for your remark. 1 form/report times 2.5 works rather well provided existing functionality is preserved. For new projects 1 (final) form/report times 4 is a better ballpark figure. This is software development industry wide experience. It doesn't matter what framework etc. is used. BTW, your framework could be relatively easy ported to .NET, I suppose. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 4:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 08:16:51 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 09:16:51 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Message-ID: <4AD87243.8080200@colbyconsulting.com> Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Thank you for your remark. > > 1 form/report times 2.5 works rather well provided existing functionality is > preserved. For new projects 1 (final) form/report times 4 is a better > ballpark figure. This is software development industry wide experience. It > doesn't matter what framework etc. is used. BTW, your framework could be > relatively easy ported to .NET, I suppose. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 4:17 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? > > It also depends on many other things. For example if you were to convert > one of my projects you > would be facing my framework and tons of classes and modules. That stuff > might just convert but > maybe not. How about DAO specific code in modules? I reference databases, > recordsets, fields, even > properties of fields, I use dynamic queries modifying TDFs in code, I build > dynamic SQL and execute > it with the database object. > > I have error logging, login logging, usage of forms logging. I control > access to forms and controls > on forms based on user/group/usergroup security, manipulating Enabled, > Locked and Visible properties > based on the user rights. I control subform loading based on whether a ton > of controls two forms up > have valid data in them, allowing supervisors to override but not normal > users. > > Also what BE are you going to? SQL Server? Staying with an MDB? How about > VBA functions embedded > in queries? Are you moving from DAO bound to ADO unbound? Are you setting > a DAO recordset to the > form's recordset clone and then doing stuff behind the scenes? I am now > using pass through queries > to pull data from SQL Server views. > > How about import / export of data? My applications strip files off of email > and download from FTP > sites, and even watch directories, then convert to / from CSV and fixed > width files, importing and > exporting to tables. I have table driven code which builds fixed width > reports with header and > footer information based on mainframe specs provided by banks and insurance > companies. > > Your formula would probably work if the original was written by a power user > (or summer intern in > the case of NorthWind). I would be VERY hesitant to make a firm quote on > such a rule of thumb. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hello Dan, >> >> I'd count it as one form/report => 1 day => times 2.5 = that would include >> all project costs not only development. >> But if you do not plan to change any functionality then it can be done >> quicker - here is a real life conversion case's stats online: >> >> http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 >> >> The estimations were between 45 and 165 hours - just for conversion >> development work - average estimation was exactly around the final figure: >> ~65 hours for 35 forms/reports (with subforms/sureports). Final result is >> not "industry strong" - it would need another 60 hours to make it > "industry >> strong", even more time would be needed to write docs and online help if >> needed etc. - all in all it will be 1 day for 1 form/report for such a >> simple application... >> >> Of course it also depends on how experienced your developers are, what >> architecture your converted system is planned to have etc. >> >> Thank you. >> >> -- >> Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 08:57:25 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 17:57:25 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD87243.8080200@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> <4AD87243.8080200@colbyconsulting.com> Message-ID: <006f01ca4e68$989fdf60$c9df9e20$@spb.ru> Hi John, You can use DAO in C#/VB.NET, although you can't bind forms/reports (MSReportViewerControl) to DAO recordsets therefore yes, DAO has to be removed I suppose. But if you're so "sticky" (:) kidding) to DAO you can model/simulate it via ADO.NET. It shouldn't be a big issue to create wrapper classes simulating DAO (the DAO features you use - this subset is rather limited I expect) but using ADO.NET, and then that wrapper classes can have properties, which can be bound to e.g. WinForms... WithEvents is everywhere in .NET - you'll feel OK with that. WinForms events do differ from MS Access forms' ones but you can find good equivalents I suppose. All in all I still suppose that conversion of your framework to .NET wouldn't be a complicated task - I'd propose to do that conversion not literally but conceptually - preserving your framework's principles/concepts/architecture but substituting (and not trying to simulate) technologies as DAO with the .NET native ones... I must also note that nowadays (in the near future with release of .NET Framework 4.0/VS 2010) we will get so powerful framework from MS that developing custom frameworks would become an overkill... <<< Microsoft kindly gave us the DAO object model and I know it (and program it) very well. >>> Well, DAO forced so many developers to think too straightforward navigational way, and it (DAO) was developed the time when it was already clear for many years that a one working with relational databases should better use "set thinking" approach - it was a real PITA to use DAO all that years, how many "spaghetti" code was developed because of that... In .NET as I noted already in another thread here for enterprise level apps and small businesses custom apps when programming against backend DBs are that MS Access or MS SQL ones - you usually need just a few - I'd count less than ten classes and methods of ADO.NET. Yes, I understand in your framework you make many run-time dynamic SQL-scripts generation - you will not need that in .NET - but if you'll need you can use NHibernate for dynamic objects/SQL or many code generation tools for static objects/SQL generation etc. - and I'd rely solely on ADO.NET Entity Framework starting .NET Framework v.4.0 ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 5:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com <<< snipped >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From dwaters at usinternet.com Fri Oct 16 09:09:59 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 09:09:59 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Oct 16 11:00:26 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 09:00:26 -0700 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: Just be aware that conversion tools do splendidly if what they're converting is fairly straight-forward objects and code. They fall in a heap over complex subforms and subreports. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 7:10 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 16 12:56:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 21:56:52 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 13:27:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 14:27:05 -0400 Subject: [dba-VB] Threads and stuff Message-ID: <4AD8BAF9.4070304@colbyconsulting.com> I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Oct 16 15:00:20 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 13:00:20 -0700 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: Are you declaring the properties shared? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 11:27 AM To: VBA Subject: [dba-VB] Threads and stuff I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 16 15:06:16 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 15:06:16 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 16 15:33:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 16:33:05 -0400 Subject: [dba-VB] Threads and stuff In-Reply-To: References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <4AD8D881.8050103@colbyconsulting.com> Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 15:40:12 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Oct 2009 00:40:12 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: <008a01ca4ea0$ddae6c10$990b4430$@spb.ru> Hi Dan, OK, that sounds good - a good candidate application for automated conversion I mean :) 50KB of code isn't that much to clean-up after automated conversion but it's important to know what this code does? For example, once in the very beginning of my .NET development practice I have got converted advanced MS Excel VB6 COM add-in with about 10,000-15,000(?) code lines into VB.NET COM add-in - conversion of VB6 code into VB.NET is a built-in feature of Visual Studio but after that conversion I have spent about three days to make the converted code up & running, and I have got all that add-in functionality working OK. That add-in code didn't use database and if your code is like that - i.e. it is mainly utility/business layer functionality without that much db communication and without a lot of built-in SQL then clean-up of 50KB of code lines after automatic conversion could be done in max. 15 days. You can try to use the tools you mentioned with Northwind db - and I (and maybe somebody else also here) can have a look on the results of automatic conversion, and then we can tell more clearly how good this automatic conversion is. I'd note that the companies who sell such conversion tools do usually have rather limited evaluation versions - if such evaluation version will not be able to process NorthWind sample app (do they have it already processed as sa ample?) maybe you can contact them directly and ask to run the full version against Northwind and send you the converted result for evaluation. It's not an issue IMO for evaluation that converted app will have MS Access BE because the main part of work of your app conversion is currently expected to be forms/reports + code conversion... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Saturday, October 17, 2009 12:06 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From michael at ddisolutions.com.au Sun Oct 18 17:47:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 19 Oct 2009 09:47:17 +1100 Subject: [dba-VB] Threads and stuff References: <4AD8BAF9.4070304@colbyconsulting.com> <4AD8D881.8050103@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01582518@ddi-01.DDI.local> Hi John, I havn't delved deeply into the threading model in .net. I have used the background worker object from time to time though. The way that works is using events to pass data to and from your threaded class. It's always worked well for my modest needs. That said, will the 'volatile' keyword help you? Cheers Michael M Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Oct 19 00:44:23 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Oct 2009 09:44:23 +0400 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <00d601ca507f$38e682e0$aab388a0$@spb.ru> <<< Anyway, because the class method that the thread runs has to be static >>> Hi John, Threads can run on instance methods - here is just a quick sample - no static methods used at all except console app's entry method: using System; using System.Threading; namespace ConsoleApplication1 { public class ThreadRunner { private int _threadNum; public ThreadRunner(int threadNum) { _threadNum = threadNum; } public void Run() { Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} started, Id = {2}", DateTime.Now, _threadNum, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(1100 - _threadNum*100 ); Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} finished.", DateTime.Now, _threadNum); } } public class ThreadManager { public void StartThreads() { for (int i = 1; i<=10; i++) { Thread th = new Thread(RunThread); th.Start(new ThreadRunner(i)); } } public void RunThread(object threadRunner) { ThreadRunner tr = (ThreadRunner)threadRunner; tr.Run(); } } class Program { static void Main(string[] args) { (new ThreadManager()).StartThreads(); } } } Here is output this sample produces: 09:41.53.519: Thread#3 started, Id = 5 09:41.53.519: Thread#1 started, Id = 3 09:41.53.522: Thread#4 started, Id = 6 09:41.53.524: Thread#5 started, Id = 7 09:41.53.520: Thread#2 started, Id = 4 09:41.53.524: Thread#6 started, Id = 8 09:41.53.524: Thread#7 started, Id = 9 09:41.53.524: Thread#8 started, Id = 10 09:41.53.524: Thread#9 started, Id = 11 09:41.53.524: Thread#10 started, Id = 12 09:41.53.625: Thread#10 finished. 09:41.53.724: Thread#9 finished. 09:41.53.824: Thread#8 finished. 09:41.53.924: Thread#7 finished. 09:41.54.024: Thread#6 finished. 09:41.54.124: Thread#5 finished. 09:41.54.223: Thread#4 finished. 09:41.54.323: Thread#3 finished. 09:41.54.424: Thread#2 finished. 09:41.54.523: Thread#1 finished. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 10:27 PM To: VBA Subject: [dba-VB] Threads and stuff .... Anyway, because the class method that the thread runs has to be static ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4520 (20091018) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Oct 19 05:13:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 19 Oct 2009 12:13:46 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil My contact has been on vacation. He'll forward me some info later today which I will forward to you off-line. He confirms that hosting, indeed traffic, may be quite expensive in Russia. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From raibeart at gmail.com Mon Oct 19 20:31:00 2009 From: raibeart at gmail.com (Robert Stewart) Date: Mon, 19 Oct 2009 20:31:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <4add12d6.0ac0100a.3a77.520b@mx.google.com> From what I am reading, Access Whiz Options: First Option Price Bundle Price A- Access to VB .NET (Web Application): ANETVB $169.00 $60.00 B- Access to VB .NET (Windows Application): ANETVB8 $169.00 $60.00 C- Access to VB6 (Windows Application): AccessToVB6 $94.00 $40.00 D- Access to C# (Web Application) ANETVC $169.00 $60.00 E- Access to Crystal Reports 8 or later: AccessToCR $169.00 $60.00 F- Access Form Controls to VB .NET: ANETVBF $45.00 $25.00 G- Access Form Controls to C# .NET: ANETVCF $45.00 $25.00 H- Access to C# (Windows Application): ANETVC7 $169.00 $60.00 Looks like it would cost me: D - $169 E - $ 60 G - $ 25 ______ $254 To be able to do a complete conversion, plus the cost of Crystal. On the second one, the link is broken to the 2003 databases, and it only converts to VB6. I think they are a bit too far behind the times to be very useful. I will take a look at the first one and let the list know back what I think about it. I think my code is pretty good and standard. So, it should not be that difficult for the program to convert it to C#. I have a project about double the size of yours to convert to ASP.net. So a tool like this might be very useful. In looking at the download page when they send it to you, System Requirements Supported Operating Systems: Windows 2000; Windows Server 2003; Windows Server 2008; Windows Vista; Windows XP Required Software: Access 2000 or later; Full version of Crystal Reports RDC, Report Designer Component 8 or later is required for AccessToCR, Access Whiz Option E; Microsoft .NET Framework SDK 1.x or 2.0 is required for Access Whiz Options A, B, D, F, G and H Display: 1024 x 768 high color I am not sure how helpful .Net 2.0 is going to be when I am doing everything in 3.5 SP1. Also, notice that The full version of Crystal Reports RDC is required to do the report conversions. You might also want to take a look at their FAQ page. There seems to be a lot it does not do. At 12:00 PM 10/16/2009, you wrote: >Date: Fri, 16 Oct 2009 09:09:59 -0500 >From: "Dan Waters" >Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? >To: "'Discussion concerning Visual Basic and related programming > issues.'" >Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD at danwaters> >Content-Type: text/plain; charset="iso-8859-1" > >Hi Shamil, > >This is exactly what I was hoping would be available! Great! > >I have a direct conversion project with 175 forms/reports. Most are simple >but some are complex. I also have 89 standard modules/class modules. SQL >Server 2005 will contain the BE. So, this is a lot of work. > >I did find 2 software utility tools which will do conversion of objects in >Access to objects in VB.Net. > > 1) http://www.microtools.us/ this is $160. > 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. > >If either even works fairly well, that would be the way to go. > >These both have demo versions so if someone wants to try them out and report >back that would be helpful. I don't know enough of VB.Net yet to make a >good assessment. > >Thanks! >Dan From jwcolby at colbyconsulting.com Tue Oct 20 10:45:20 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 11:45:20 -0400 Subject: [dba-VB] C# replace a special character Message-ID: <4ADDDB10.4010703@colbyconsulting.com> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Oct 20 11:21:32 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 20 Oct 2009 18:21:32 +0200 Subject: [dba-VB] C# replace a special character Message-ID: Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From drawbridgej at sympatico.ca Tue Oct 20 11:27:20 2009 From: drawbridgej at sympatico.ca (Jack and Pat) Date: Tue, 20 Oct 2009 12:27:20 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 20 11:33:44 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:33:44 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: I think the overhead of RegEx would be too high on a really large replace. It works great, but it isn't the fastest way. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Tue Oct 20 11:34:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:34:42 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Except the for the semicolon, that's the way to do it in VB.Net too. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 20, 2009 9:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav From marklbreen at gmail.com Tue Oct 20 12:39:06 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 20 Oct 2009 18:39:06 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Hello John, I used the following SQL today, and it works a treat, in my case, I wanted to exclude all except alphas, I know that it is not C#, and I know you may prefer C# as practice, so if it is no useful, just bin it. I got the code from this site, if you have a look, there is a little more there that you may be able to make use of. Thanks to Nigel Rivett. http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html WHILE @@rowcount > 0 UPDATE tablename SET columnname = REPLACE(columnname, SUBSTRING(columnname, PATINDEX('%[^a-zA-Z0-9]%', columnname), 1), '') WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 Mark 2009/10/20 Charlotte Foust > Except the for the semicolon, that's the way to do it in VB.Net too. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Tuesday, October 20, 2009 9:22 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] C# replace a special character > > Hi John > > You should be able to use the Replace method directly on your string > holding the line or the file: > > theStringToCleanUp.Replace(((char)26).ToString(),""); > > like: > > string contents = File.ReadAllText(path); > File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Tue Oct 20 12:47:02 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 10:47:02 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Just a minor note: Even in that small piece of code there is an error. It reads: string output = Regex.Replace(input, "N.t", "NET"); ...but it should read: string output = Regex.Replace(input, "Not", "NET"); Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Tue Oct 20 12:54:31 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 18:54:31 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: <4addf97f.0c11660a.320f.1168@mx.google.com> Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Tue Oct 20 13:10:50 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:10:50 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Message-ID: <9347022991EF4B13A31B779024041F56@creativesystemdesigns.com> I have no idea how fast this 'search and replace' product is but according to a friend, it is a great little product for searching non indexed hard drives... far faster than Windows own indexing, according to him. http://www.inforapid.de/html/searchreplace.htm HTH Jim From accessd at shaw.ca Tue Oct 20 13:29:11 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:29:11 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4addf97f.0c11660a.320f.1168@mx.google.com> References: <4addf97f.0c11660a.320f.1168@mx.google.com> Message-ID: <17B53F39615F4A1BB67C69C33BE5CBB3@creativesystemdesigns.com> STREAMING would be even faster... I switched some ADO code from CHUNK picture data retrieval to ADO to Stream, a number of years ago, on a project and the transfer rate was on an order of magnitude faster. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 20, 2009 10:55 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 20 14:49:26 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 Oct 2009 23:49:26 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Hi John, Try this code snippet changing input and output files' paths: int bufferSize = 1024*1024; string inputFile = @"c:\temp\inputFile.txt"; string outputFile = @"c:\temp\outputFile.txt"; System.IO.FileStream inputStream = new System.IO.FileStream( inputFile, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None, bufferSize); System.IO.FileStream outputStream = new System.IO.FileStream( outputFile, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None, bufferSize); byte[]data = new byte[bufferSize]; int offset = 0; int totalLength = 0; int length = 0; while ((length = inputStream.Read(data, offset, bufferSize)) > 0) { totalLength += length; string text = System.Text.Encoding.ASCII.GetString(data); text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; data = System.Text.Encoding.ASCII.GetBytes(text); outputStream.Write(data, offset, length); } inputStream.Close(); outputStream.Close(); Console.WriteLine("Total length test: {0}", totalLength); HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 7:45 PM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Tue Oct 20 14:53:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:53:22 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <4ADE1532.2000109@colbyconsulting.com> It is my guess that Regex will be too slow. This will be a file with about 100 characters average per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but reading in 200 million bytes all at once could cause issues. John W. Colby www.ColbyConsulting.com Jack and Pat wrote: > John, > > I did a google search to find this link. I'm not a C# person, but thought > I'd pass this on > > http://dotnetperls.com/regex-replace-1 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 11:45 AM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From jwcolby at colbyconsulting.com Tue Oct 20 14:56:33 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:56:33 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADE15F1.1050803@colbyconsulting.com> Thanks Mark. Doing it inside SQL Server is the ideal for sure. ATM I only have the issue in the Address field of the typical FName, LName, Addr, City, St, Zip5, Zip4 record. Thinking about it though you could conceivably have this issue in any field. I will definitely check this out though. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 20 15:00:53 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 16:00:53 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com> <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Message-ID: <4ADE16F5.6030600@colbyconsulting.com> Thanks Shamil! John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Try this code snippet changing input and output files' paths: > > int bufferSize = 1024*1024; > > string inputFile = @"c:\temp\inputFile.txt"; > string outputFile = @"c:\temp\outputFile.txt"; > > System.IO.FileStream inputStream = > new System.IO.FileStream( > inputFile, > System.IO.FileMode.Open, > System.IO.FileAccess.Read, > System.IO.FileShare.None, > bufferSize); > System.IO.FileStream outputStream = > new System.IO.FileStream( > outputFile, > System.IO.FileMode.Create, > System.IO.FileAccess.Write, > System.IO.FileShare.None, > bufferSize); > > byte[]data = new byte[bufferSize]; > int offset = 0; > int totalLength = 0; > int length = 0; > while ((length = inputStream.Read(data, offset, bufferSize)) > 0) > { > totalLength += length; > > string text = System.Text.Encoding.ASCII.GetString(data); > text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; > data = System.Text.Encoding.ASCII.GetBytes(text); > > outputStream.Write(data, offset, length); > } > > inputStream.Close(); > outputStream.Close(); > > Console.WriteLine("Total length test: {0}", totalLength); > > HTH. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 7:45 PM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From stuart at lexacorp.com.pg Tue Oct 20 16:28:39 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 21 Oct 2009 07:28:39 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE1532.2000109@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP>, <4ADE1532.2000109@colbyconsulting.com> Message-ID: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> 200 megabytes tirivial. I just knocked this up in PowerBasic (this is the complete program!): #COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG LOCAL strFile AS STRING LOCAL lngSTart AS LONG LOCAL strData AS STRING strFile = "ML_Data.mdb" lngStart = TIMER OPEN strFile FOR BINARY AS #1 GET$ #1, LOF(1), strData CLOSE #1 REPLACE "A" WITH "B" IN strData OPEN strfile & "fixed" FOR BINARY as#1 PUT$ #1, strData CLOSE #1 MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" END FUNCTION It compiles to an 11KB executable with no dependencies. It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of that time was taken in reading and writing the file to/from memory. -- Stuart On 20 Oct 2009 at 15:53, jwcolby wrote: > It is my guess that Regex will be too slow. This will be a file with about 100 characters average > per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but > reading in 200 million bytes all at once could cause issues. > > John W. Colby > www.ColbyConsulting.com > > > Jack and Pat wrote: > > John, > > > > I did a google search to find this link. I'm not a C# person, but thought > > I'd pass this on > > > > http://dotnetperls.com/regex-replace-1 > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Tuesday, October 20, 2009 11:45 AM > > To: VBA > > Subject: [dba-VB] C# replace a special character > > > > I have a file which contains a sprinkling of a special character - decimal > > 26, hex 1A (the SUB > > character). This special character in the CSV file output to Accuzip causes > > Accuzip to hiccup. In > > order to get on with my life I need to pre-process the files to get rid of > > this special character. > > Because of the size of these files (hundreds of mbytes) I need to do a > > readline / replace / > > writeline kind of thing. I think I need to use the stringbuilder.replace > > but I do not know how to > > specify replacing this hex 1A with something else. The something else would > > ideally be nothing > > (empty string) but can be any valid alpha character (A, B etc). > > > > Can anyone help me with this replace part of the problem. C# syntax please. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From max.wanadoo at gmail.com Tue Oct 20 17:12:19 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 23:12:19 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: What if the input line wont fit into memory? max On 20/10/2009, Stuart McLachlan wrote: > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > >> It is my guess that Regex will be too slow. This will be a file with >> about 100 characters average >> per line, 2 million lines. Doing this in one big read MIGHT be possible >> (and I will try) but >> reading in 200 million bytes all at once could cause issues. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Jack and Pat wrote: >> > John, >> > >> > I did a google search to find this link. I'm not a C# person, but >> > thought >> > I'd pass this on >> > >> > http://dotnetperls.com/regex-replace-1 >> > >> > -----Original Message----- >> > From: dba-vb-bounces at databaseadvisors.com >> > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> > Sent: Tuesday, October 20, 2009 11:45 AM >> > To: VBA >> > Subject: [dba-VB] C# replace a special character >> > >> > I have a file which contains a sprinkling of a special character - >> > decimal >> > 26, hex 1A (the SUB >> > character). This special character in the CSV file output to Accuzip >> > causes >> > Accuzip to hiccup. In >> > order to get on with my life I need to pre-process the files to get rid >> > of >> > this special character. >> > Because of the size of these files (hundreds of mbytes) I need to do a >> > readline / replace / >> > writeline kind of thing. I think I need to use the >> > stringbuilder.replace >> > but I do not know how to >> > specify replacing this hex 1A with something else. The something else >> > would >> > ideally be nothing >> > (empty string) but can be any valid alpha character (A, B etc). >> > >> > Can anyone help me with this replace part of the problem. C# syntax >> > please. >> > >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 21 08:56:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 09:56:21 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF1305.1090809@colbyconsulting.com> Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Jay.Hunnicutt at med.navy.mil Wed Oct 21 09:25:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 10:25:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF1305.1090809@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: John, If you make it a SQL Scalar function you can use it to strip characters for select, Update and insert statements as needed. Makes it a little easier to use as well as reusable. CREATE FUNCTION F_DropSpecChar ( -- Add the parameters for the function here @S varchar(100) ) RETURNS varchar(100) AS BEGIN -- Declare the return variable here DECLARE @Result varchar(100) DECLARE @i INTEGER select @i = patindex('%[^a-zA-Z0-9 ]%', @s) while @i > 0 begin select @s = replace(@s, substring(@s, @i, 1), '') select @i = patindex('%[^a-zA-Z0-9 ]%', @s) end SELECT @Result = @S -- Return the result of the function RETURN @Result END GO Query: select dbo.F_DropSpecChar('qh*(*^&$^1234') Returns: qh1234 Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 9:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I > wanted to exclude all except alphas, I know that it is not C#, and I > know you may prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little > more there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >> Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); File.WriteAllText(path, >> contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:09:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:09:22 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: <4ADF2422.7060204@colbyconsulting.com> I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes it > a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Oct 21 10:23:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:23:43 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF277F.60802@colbyconsulting.com> Mark, Below is the SP I created to perform this magic. I will be running this on 66 million records so we shall see about performance. set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: -- Create date: -- Description: -- --WHILE @@rowcount > 0 -- UPDATE tablename -- SET columnname = REPLACE(columnname, -- SUBSTRING(columnname, -- PATINDEX('%[^a-zA-Z0-9]%', -- columnname), 1), '') -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 -- -- ============================================= ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] -- Add the parameters for the stored procedure here @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @SQL varchar(1000) declare @PatIndex varchar(50) BEGIN TRY set @PatIndex = '%[^a-zA-Z0-9 .,#]%' SELECT @SQL = 'WHILE @@rowcount > 0 UPDATE ' + @DBName + '.dbo.' + @TblName + ' SET ' + @FldName + ' = REPLACE(' + @FldName + ', SUBSTRING(' + @FldName + ', PATINDEX(''' + @PatIndex + ''', ' + @FldName + '), 1), '''') WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' exec (@SQL) print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName END TRY BEGIN CATCH print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName print @SQL print ERROR_MESSAGE() END CATCH END John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark From Jay.Hunnicutt at med.navy.mil Wed Oct 21 10:28:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 11:28:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2422.7060204@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: John, Just add the comma into the accepted characters like patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces and the spaces are left in the return as they are not a part of the condition. Query: select dbo.F_DropSpecChar('abc fge, 123, NC') Returns: abc fge, 123, NC Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 11:09 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes > it a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:46:47 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:46:47 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: <4ADF2CE7.4050902@colbyconsulting.com> Jay, Thanks for that. I figured it out, added the special characters that I need and tested it and it is working great. And pretty darned fast IMHO. I did a replace on one field, 62.8 million records, 2:52 (three minutes). Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores assigned to SQL Server. John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > Just add the comma into the accepted characters like > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > and the spaces are left in the return as they are not a part of the > condition. > > Query: > select dbo.F_DropSpecChar('abc fge, 123, NC') > > Returns: > > abc fge, 123, NC > > Jay Hunnicutt From jwcolby at colbyconsulting.com Wed Oct 21 10:47:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:47:13 -0400 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF277F.60802@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> Message-ID: <4ADF2D01.9000308@colbyconsulting.com> Just an FYI, I ran this against 1 million records, in a query that pulled the top(1000000) City fields (where this specific problem lies) and it took about 13 seconds. This is with an index in place that includes the city field. I then ran it against the entire table (62.8 million records) and it took 2 minutes 52 seconds. This will become a standard part of my program for cleaning up my data. Thanks Mark Breen! John W. Colby www.ColbyConsulting.com jwcolby wrote: > Mark, > > Below is the SP I created to perform this magic. I will be running this on 66 million records so we > shall see about performance. > > set ANSI_NULLS ON > set QUOTED_IDENTIFIER ON > go > > -- ============================================= > -- Author: > -- Create date: > -- Description: > -- > --WHILE @@rowcount > 0 > -- UPDATE tablename > -- SET columnname = REPLACE(columnname, > -- SUBSTRING(columnname, > -- PATINDEX('%[^a-zA-Z0-9]%', > -- columnname), 1), '') > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > -- > -- ============================================= > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > -- Add the parameters for the stored procedure here > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > AS > BEGIN > -- SET NOCOUNT ON added to prevent extra result sets from > -- interfering with SELECT statements. > SET NOCOUNT ON; > declare @SQL varchar(1000) > declare @PatIndex varchar(50) > > BEGIN TRY > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > SELECT @SQL = 'WHILE @@rowcount > 0 > UPDATE ' + @DBName + '.dbo.' + @TblName + ' > SET ' + @FldName + ' = REPLACE(' + @FldName + ', > SUBSTRING(' + @FldName + ', > PATINDEX(''' + @PatIndex + ''', > ' + @FldName + '), 1), '''') > WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' > exec (@SQL) > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > END TRY > BEGIN CATCH > print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > print @SQL > print ERROR_MESSAGE() > END CATCH > END > > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I wanted >> to exclude all except alphas, I know that it is not C#, and I know you may >> prefer C# as practice, so if it is no useful, just bin it. >> >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> PATINDEX('%[^a-zA-Z0-9]%', >> columnname), 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:27:36 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:27:36 +0100 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2CE7.4050902@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> <4ADF2CE7.4050902@colbyconsulting.com> Message-ID: Hello John, As they say, when you only have a hammer, everything looks like a nail. My hammer is my SQL Skills, and I know that I sometimes use them where C# would be more appropriate, I see from Shamils code how easy it is in .Net also, anyway, we all have the options now of c#, PB and TSQL. Glad it worked, thanks Mark 2009/10/21 jwcolby > Jay, > > Thanks for that. I figured it out, added the special characters that I > need and tested it and it is > working great. And pretty darned fast IMHO. I did a replace on one field, > 62.8 million records, > 2:52 (three minutes). > > Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores > assigned to SQL Server. > > John W. Colby > www.ColbyConsulting.com > > > Hunnicutt, Jay E. (Civ) wrote: > > John, > > Just add the comma into the accepted characters like > > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > > and the spaces are left in the return as they are not a part of the > > condition. > > > > Query: > > select dbo.F_DropSpecChar('abc fge, 123, NC') > > > > Returns: > > > > abc fge, 123, NC > > > > Jay Hunnicutt > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:29:54 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:29:54 +0100 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF2D01.9000308@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> <4ADF2D01.9000308@colbyconsulting.com> Message-ID: Hello John, thanks for the credit, but the real credit goes to Nigel Rivett. But thanks anyway Have a nice weekend, Mark Mark Breen said >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> 2009/10/21 jwcolby > Just an FYI, I ran this against 1 million records, in a query that pulled > the top(1000000) City > fields (where this specific problem lies) and it took about 13 seconds. > This is with an index in > place that includes the city field. I then ran it against the entire table > (62.8 million records) > and it took 2 minutes 52 seconds. > > This will become a standard part of my program for cleaning up my data. > > Thanks Mark Breen! > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: > > Mark, > > > > Below is the SP I created to perform this magic. I will be running this > on 66 million records so we > > shall see about performance. > > > > set ANSI_NULLS ON > > set QUOTED_IDENTIFIER ON > > go > > > > -- ============================================= > > -- Author: > > -- Create date: > > -- Description: > > -- > > --WHILE @@rowcount > 0 > > -- UPDATE tablename > > -- SET columnname = REPLACE(columnname, > > -- SUBSTRING(columnname, > > -- > PATINDEX('%[^a-zA-Z0-9]%', > > -- columnname), 1), > '') > > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > -- > > -- ============================================= > > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > > -- Add the parameters for the stored procedure here > > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > > AS > > BEGIN > > -- SET NOCOUNT ON added to prevent extra result sets from > > -- interfering with SELECT statements. > > SET NOCOUNT ON; > > declare @SQL varchar(1000) > > declare @PatIndex varchar(50) > > > > BEGIN TRY > > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > > SELECT @SQL = 'WHILE @@rowcount > 0 > > UPDATE ' + @DBName + > '.dbo.' + @TblName + ' > > SET ' + @FldName + ' = > REPLACE(' + @FldName + ', > > SUBSTRING(' + @FldName + ', > > PATINDEX(''' + @PatIndex + > ''', > > ' + @FldName + > '), 1), '''') > > WHERE PATINDEX(''' + > @PatIndex + ''', ' + @FldName + ') <> 0' > > exec (@SQL) > > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + > @TblName + '.' + @FldName > > END TRY > > BEGIN CATCH > > print 'There was an error REPLACING CHARACTERS IN ' + > @DBName + '.' + @TblName + '.' + @FldName > > print @SQL > > print ERROR_MESSAGE() > > END CATCH > > END > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Mark Breen wrote: > >> Hello John, > >> I used the following SQL today, and it works a treat, in my case, I > wanted > >> to exclude all except alphas, I know that it is not C#, and I know you > may > >> prefer C# as practice, so if it is no useful, just bin it. > >> > >> I got the code from this site, if you have a look, there is a little > more > >> there that you may be able to make use of. > >> > >> Thanks to Nigel Rivett. > >> > >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > >> > >> > >> > >> WHILE @@rowcount > 0 > >> UPDATE tablename > >> SET columnname = REPLACE(columnname, > >> SUBSTRING(columnname, > >> PATINDEX('%[^a-zA-Z0-9]%', > >> columnname), 1), > '') > >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > >> > >> > >> > >> > >> Mark > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:31:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:31:16 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: Hello Stuart, Have not heard of PowerBasic since 2001, is is still in use? or is this an old language that you still use through familiarity? Thanks Mark 2009/10/20 Stuart McLachlan > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > It is my guess that Regex will be too slow. This will be a file with > about 100 characters average > > per line, 2 million lines. Doing this in one big read MIGHT be possible > (and I will try) but > > reading in 200 million bytes all at once could cause issues. > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Jack and Pat wrote: > > > John, > > > > > > I did a google search to find this link. I'm not a C# person, but > thought > > > I'd pass this on > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > To: VBA > > > Subject: [dba-VB] C# replace a special character > > > > > > I have a file which contains a sprinkling of a special character - > decimal > > > 26, hex 1A (the SUB > > > character). This special character in the CSV file output to Accuzip > causes > > > Accuzip to hiccup. In > > > order to get on with my life I need to pre-process the files to get rid > of > > > this special character. > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > readline / replace / > > > writeline kind of thing. I think I need to use the > stringbuilder.replace > > > but I do not know how to > > > specify replacing this hex 1A with something else. The something else > would > > > ideally be nothing > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > Can anyone help me with this replace part of the problem. C# syntax > please. > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 12:53:30 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 18:53:30 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Message-ID: Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark From accessd at shaw.ca Thu Oct 22 13:53:31 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 11:53:31 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Hi Mark: If you are setting up MySQL you should start thinking of using SPs. MySQL version 5 has this feature and pass-through queries in MSAccess, especially SELECT type queries are soooo slowwwwww. Check out the following: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, October 22, 2009 10:54 AM To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Oct 22 15:00:10 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 22 Oct 2009 21:00:10 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Mark, My friend gave me this answer - hope it helps I use the dreamweaver developer toolkit QUB it works exactly like access query's but it's web based and you need both dreamweaver and the developer toolkit to upload the files logon to the mysql then run a query. I've never found one better Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 22 October 2009 18:54 To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 15:57:31 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 06:57:31 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg>, Message-ID: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From accessd at shaw.ca Thu Oct 22 18:57:38 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 16:57:38 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> Message-ID: What sort of speed does PB get? Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, October 22, 2009 1:58 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 22:29:27 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 13:29:27 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, Message-ID: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > From max.wanadoo at gmail.com Fri Oct 23 01:58:47 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 07:58:47 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Message-ID: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> But what can you do with it? I cannot think of anything that I would want to do outside of Access...is that sad or what? Fast is good, but fast doing nothing is nothing. I can do nothing instantaneously! Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 04:29 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Fri Oct 23 05:48:50 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:48:50 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Fri Oct 23 05:54:52 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:54:52 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 08:12:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 14:12:33 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: <4ae1abd3.09c5660a.471e.ffff8b17@mx.google.com> Yes he would have to have dreamweaver installed Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 23 October 2009 11:49 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 09:01:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 10:01:54 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> Message-ID: <4AE1B752.7030306@colbyconsulting.com> > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max From max.wanadoo at gmail.com Fri Oct 23 09:05:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 15:05:33 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Yes, but I do all SQL stuff FROM access. I don't have the performance issues that you do (and I understand where you are at). So, what does PB do that I need to leave Access for? I can do ANYTHING from within Access (speed issues aside) Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 23 October 2009 15:02 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 23 10:01:33 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 23 Oct 2009 10:01:33 -0500 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:02 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 10:24:22 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 19:24:22 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Hi John, I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 6:02 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Oct 23 11:02:26 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 18:02:26 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From jwcolby at colbyconsulting.com Fri Oct 23 11:25:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 12:25:01 -0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Message-ID: <4AE1D8DD.6090103@colbyconsulting.com> Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil From cfoust at infostatsystems.com Fri Oct 23 11:36:18 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 09:36:18 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan From jwcolby at colbyconsulting.com Fri Oct 23 12:00:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 13:00:18 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1E122.1020902@colbyconsulting.com> > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The two > languages will get the missing features from the other and it will then > be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur > with VS 2010 or later. But after the change, using C# or VB.Net will be > just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 12:02:12 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 18:02:12 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1e1ad.170e660a.2cdd.4c8c@mx.google.com> Presumably then, a programmer could use "exactly" the same functionality to achieve "exactly" the same result but could use the language of their choice. Ie. "Good morning", "Guten Morgen" sounds the same to the person who "understands" the output? Ie, BuiltInFunction xyz() has same out put regardless of what constructs/coding was used within the function as long as writing it in BOTH languages achieved the same output. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 23 October 2009 17:36 To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: <000901ca5407$0963f350$1c2bd9f0$@spb.ru> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <000d01ca5407$0ad75970$20860c50$@spb.ru> Hi John, Thank you for your extended comment on "C# vs. native EXE." --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 8:25 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Fri Oct 23 12:51:43 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 10:51:43 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1E122.1020902@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: But I'm not looker for higher pay and higher mystique. I'm 65 and I don't want to program forever or be a consultant at all. VB.Net definitely can do some things C# can't, another reason I never saw much point in learning C# after I made the transition to .Net. We were mandated to use VB.Net because it would make the transition from Access faster. Fine by me. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 10:00 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] c# as a language of choice > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The > two languages will get the missing features from the other and it will > then be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will > be 'equalizing' C# and VB.Net. I don't remember if that's going to > occur with VS 2010 or later. But after the change, using C# or VB.Net > will be just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Oct 23 13:00:40 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 20:00:40 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From accessd at shaw.ca Fri Oct 23 13:09:58 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:09:58 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hi Mark: If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped using ODBC, except in extreme circumstances over 10 years ago and have never looked back. Back in 1997, a client did month end reports through MS Access to a MS SQL BE DB via a pass-through implementation. The report was done in two separate sections with each section taking 50 minutes before the report would start. They would do one report in the morning and one in the afternoon. The query was a 'Select * ..." type. When I converted their month-end report to ADO-OLE and used a SP. The results were that the entire report started in less than 2 seconds. See the sample code at: http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, October 23, 2009 3:55 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:19:10 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:19:10 -0700 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <711C50C13D994C65B774F500045A395D@creativesystemdesigns.com> The truth is that under .Net there is no performance advantage to using VB.Net or C#.Net or any other .Net flavour. Also, you can mix and match code extensions as long as they are not in the same module. The only advantage I can see is that C# sounds cooler... and we know real men and women only use 'C' or derivatives thereof. ;-) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:22:52 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:22:52 -0700 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: Ha ha ha... I guess the universal translator doesn't work... no wonder there are coding problems. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 11:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS2010: Dependency Injection (DI),The Microsoft Extensibility Framework (MEF) Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 13:37:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:37:09 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1F7D5.9020405@colbyconsulting.com> > Not long ago you were just starting to use SQL Server! So much to know, so little time. John W. Colby www.ColbyConsulting.com Dan Waters wrote: > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur with > VS 2010 or later. But after the change, using C# or VB.Net will be just a > syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 23, 2009 9:02 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# replace a special character > > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > That is sad indeed. Nice that you have so much Access work that you never > need to consider anything > else though. > > I have a ton of SQL Server work for one specific client. While I can and do > use Access to perform > this work it is not very efficient. My biggest issue is simply that Access > is single threaded so > when I start a long running stored procedure out on the server, Access comes > to a screeching halt. > > I have logging processes running in the code that executes these stored > procedures. So I time how > long, what the SP name is, what specific file is being created or loaded, > date / time that the step > occurred etc. When a SP starts to run, Access locks up. I cannot see the > status log (through the > Access FE) that tells me where I am in the process. > > As you can see, while Access does function, for this kind of thing it > functions poorly. > > Personally, for a variety of reasons I am moving to C#.Net for this kind of > development. C# is now > widely accepted as a valid language by my clients, it is extremely powerful, > and it is pretty darned > fast, though it will not be as fast as a native EXE. C# has a ton of > database stuff available to it > (though I am not there yet), it has multi-threading (though I am not there > yet), and on a Windows > environment it can do pretty much anything I can imagine doing (and I have a > very active > imagination). Additionally it can be used from right inside of SQL Server > (though I am not there yet). > > For me, C# makes a lot of sense. It has a steep learning curve though. If > it weren't for the fact > that I am a consultant first and foremost, I would go with VB.Net. I > "played" with VB.Net quite a > bit in the past and it was a bit easier to come up to speed on, and every > bit as powerful as C# > within the domain of problems I would ever attempt. > > However if I ever need to sell my .Net skills, C# is just an easier sell. > > John W. Colby > www.ColbyConsulting.com > > > Max Wanadoo wrote: >> But what can you do with it? >> >> I cannot think of anything that I would want to do outside of Access...is >> that sad or what? >> >> Fast is good, but fast doing nothing is nothing. >> >> I can do nothing instantaneously! >> >> Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Oct 23 13:39:48 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:39:48 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: <4AE1F874.1040805@colbyconsulting.com> >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw much > point in learning C# after I made the transition to .Net. We were > mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte From cfoust at infostatsystems.com Fri Oct 23 13:41:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 11:41:19 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1F874.1040805@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> <4AE1F874.1040805@colbyconsulting.com> Message-ID: Even with grown kids, I figure I'll be working the rest of my life too. Just not as a programmer, please. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 11:40 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# as a language of choice >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw > much point in learning C# after I made the transition to .Net. We > were mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Oct 23 16:06:11 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 24 Oct 2009 07:06:11 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Message-ID: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > From max.wanadoo at gmail.com Fri Oct 23 22:44:51 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Sat, 24 Oct 2009 04:44:51 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> Message-ID: <4ae27855.0a04d00a.69f3.ffffd6b8@mx.google.com> Thanks Stuart, I merely meant "from my perspective and from what I do". I am sure there are tons of stuff that other people need. I used to use QB some years back for "quick apps" and it was great. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 22:06 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Oct 24 05:19:17 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 14:19:17 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <000601ca5493$728c8d60$57a5a820$@spb.ru> Hi Dan, Go for C# - VB.NET is usually just 5%(?) closer than C# to "what folks already know" when learning .NET development after VBA/VB6 - spending just a few more time now to adapt to C# syntax you'll gain considerable advantage in long run. But I suppose that using C# from the very beginning will not force to spend more time on learning curve - the opposite is true - why? - keep reading this comment... ...as William noted myriad of times here - there are a lot of C# ready to use samples - that's a very important fact for learning curve and for real life development - despite the fact that there are automatic convertors from C# to VB.NET and vice versa they are not 100% correct but even if they would have been 99% correct you would have been losing time converting C# -> VB.NET and therefore losing advantage in competition with C# developers, and this competition is becoming more and more strict every day... ...using C# you also keep saving time as you do not need to type Function, Sub, Dim, As etc. - in long run that would be a good saving of your life time to be better spent with friends and family than with computers... ...etc... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 7:02 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4537 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Oct 24 10:26:13 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 19:26:13 +0400 Subject: [dba-VB] How to script MS SQL 2005 Database Objects using .NET... Message-ID: <000001ca54be$55977870$00c66950$@spb.ru> Hi All, I'm wondering how to perform the subject task? - similar to MS SQL Management Studio: {{Database}} -> Right-Click -> Tasks -> Generate Scripts.. Etc. I guess is should be possible to write custom code to get SQL DLL scripts for a given set of tables, their relationships and triggers? Is there a ready to use object model for such coding? Or one have to use system (extended) SPs? Or..? I wanted to automate this task. And I do not want to use third-party tools currently. Thank you. -- Shamil From marklbreen at gmail.com Mon Oct 26 02:24:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Oct 2009 07:24:14 +0000 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello All, In the past I found it a PITA to use MS Access as a SQL generator for SQL Server because Access / ODBC drivers applied a prefix of the Scheme name for all the tables - dbo_Customers. This meant that I could not build a query and then copy and paste the SQL unless I first renamed the tables, either manually or with code. However, I can let you know that with the ODBC Driver and the mySQL db that I hooked up to, the tables came with just their names - Customers, so I had a successful session on Friday showing my friend how to build queries. He was delighted, one query that takes three seconds used to take them three days in the past. Interestingly, I did some tests on performace of Linked tables compared to pass-through. The biggest query we ran was a six or seven table query that we saved and then ran a cross tab against that. It ran in 2 - 3 seconds, with all tables linked and no pass through used at all. I have to say in that case, or in similar examples it is not worth while running it as pass-through. I know that in certain cases PST will be faster, but I could not demonstrate a practical example on Friday. I know the benefits, so I am not trying to persuade anyone here, but I am just noting that you may find it is not worth jumping through hoops for PST until you know you need it. Thanks to all, Mark 2009/10/23 Jim Lawrence > Hi Mark: > > If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped > using ODBC, except in extreme circumstances over 10 years ago and have > never > looked back. > > Back in 1997, a client did month end reports through MS Access to a MS SQL > BE DB via a pass-through implementation. The report was done in two > separate > sections with each section taking 50 minutes before the report would start. > They would do one report in the morning and one in the afternoon. The query > was a 'Select * ..." type. > > When I converted their month-end report to ADO-OLE and used a SP. The > results were that the entire report started in less than 2 seconds. See the > sample code at: > > > http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo > rts.asp > > HTH > Jim > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Friday, October 23, 2009 3:55 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello Jim, > thanks for that, yes, I will train him on the benefits of utilising the > Client - Server aspect of the db, > > Just curious though, if I want to return all rows from the web based > hosting > centre, and I have to choices of > a) Select * from Customers ran as a PST query or > b) usp_GetAllCustomers ran as a PST query or > c) Select * from Customers ran as a linked table in Access > > do you think that there would be any noticeable performance difference, my > instinct would be that there would be none. > > Of course if there was a million orders and we wanted to sum all orders > where customer id = 22124, that would have to be better as Pass Through, > but > I would assume minor differences between an sproc and simply including all > the SQL within the PST query. We would loose the precomplile but from a > data and query perspective, I would expect similar (1-2 seconds) > performance. > > Thanks > > Mark > > > > > 2009/10/22 Jim Lawrence > > > Hi Mark: > > > > If you are setting up MySQL you should start thinking of using SPs. MySQL > > version 5 has this feature and pass-through queries in MSAccess, > especially > > SELECT type queries are soooo slowwwwww. > > > > Check out the following: > > > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > > > HTH > > Jim > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > > Sent: Thursday, October 22, 2009 10:54 AM > > To: Discussion of Hardware and Software issues; Discussion concerning > > Visual > > Basic and related programming issues. > > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > > > Hello All, > > I have to assist a friend tomorrow in connecting to a mySQL database and > > starting to build some queries. > > > > I intend to show him the differences between writing queries in MS Access > > when linked to mySQL, and using pass-through queries within Access. > > > > I will also be explaining the benefits of having a few views created > also. > > > > What I am looking for is a Windows based GUI tool that would connect to > > mySQL and allow him to build queries with click and drag like SSMS or > > Access > > does. > > > > This evening I have downloaded and installed two tools, one is the > default > > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > > initial looking anyway, to to allow me to drag a few fields from a table, > > but they do not seems to allow me to drag two or three tables and for the > > joins to be done in the GUI. > > > > Would anyone have any suggestions? > > > > TIA for your time, > > > > Mark > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Oct 26 07:51:17 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 08:51:17 -0400 Subject: [dba-VB] C# - How to access objects in inherited list Message-ID: <4AE59B45.7030003@colbyconsulting.com> Just to learn how, I am trying to subclass a generic list class. My grade calculator previously dimensioned a list and used it. The syntax to access objects in the list in that case was MyList{MyIndex]. In my class definition I subclassed my Grades to inherit the list class. class clsGrades: List { } Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the name of the list property that [] references? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Oct 26 08:13:24 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 09:13:24 -0400 Subject: [dba-VB] C# - How to access objects in inherited list In-Reply-To: <4AE59B45.7030003@colbyconsulting.com> References: <4AE59B45.7030003@colbyconsulting.com> Message-ID: <4AE5A074.50900@colbyconsulting.com> Well, I don't have a clue what I was doing before but this[] does work. My guess is that I was using This[] (capital T) instead of this[]. Anyway, I got it working. Sorry for the ring. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Just to learn how, I am trying to subclass a generic list class. > > My grade calculator previously dimensioned a list and used it. The syntax to access objects in the > list in that case was MyList{MyIndex]. > > In my class definition I subclassed my Grades to inherit the list class. > > class clsGrades: List > { > } > > Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the > life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the > name of the list property that [] references? > > TIA > From dwaters at usinternet.com Mon Oct 26 12:03:22 2009 From: dwaters at usinternet.com (Dan Waters) Date: Mon, 26 Oct 2009 12:03:22 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? Message-ID: Hello! I have some code from a forum that I believe may allow dragging a file to an Access for so that the file's full path can be captured by the form. If this can be done, then a file can be very easily 'attached' to an Access database. The code comes from here: http://bytes.com/topic/access/answers/197392-drag-drop The code was originally written by Felix Lima (MS Support Engineer), and posted by Stephen Lebans. I first tried putting this code into an mdb, but the database froze because the code that was waiting for a Windows Message ran continuously. So, I want to ask if someone can take this code and put it into a DLL file like Felix says it should be. I've put it all into a small Access file that I can send to you. If this works, I'll post a 'how to' in DB Advisors. Thanks! Dan From davidmcafee at gmail.com Mon Oct 26 12:11:52 2009 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 26 Oct 2009 10:11:52 -0700 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: Message-ID: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From DWUTKA at Marlow.com Tue Oct 27 12:05:18 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 27 Oct 2009 12:05:18 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Monday, October 26, 2009 12:12 PM To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 dwaters at usinternet.com Tue Oct 27 18:53:27 2009 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 27 Oct 2009 18:53:27 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew From michael at ddisolutions.com.au Tue Oct 27 19:03:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 28 Oct 2009 11:03:17 +1100 Subject: [dba-VB] Create a DLL for Access Drag Drop? References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015825AE@ddi-01.DDI.local> Hi Dan, In the dim dark past I think I did something like this. IIRC you supply the Data object (can be anything) in the StartDrag(?) event. I could be wrong... Cheers Michael Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Oct 28 15:29:26 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 28 Oct 2009 15:29:26 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Close your database, and reopen it. DO NOT go into any VBA code AT ALL. See if your procedure works. It probably should (though I haven't actually tried your code). The problem is that when ANY callback function runs, if the VBE has been opened, it will freak Access out like crazy! As for code to use a treeview: Option Compare Database Dim tvw As TreeView Private Sub Form_Load() Set tvw = Me.TreeView0.Object End Sub Private Sub Form_Unload(Cancel As Integer) Set tvw = Nothing End Sub Private Sub TreeView0_OLEDragDrop(Data As Object, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim nd As Node Select Case DetermineDropType(Data) Case "TEXT" Case "FILES" Case Else MsgBox "Invalid Object Type" End Select End Sub Function DetermineDropType(Data As Object) As String On Error Resume Next Dim strTemp As String strTemp = Data.GetData(1) If Not Err Then DetermineDropType = "TEXT" Exit Function End If Err.Clear If Data.Files.Count > 0 Then DetermineDropType = "FILES" End If End Function In the case 'FILES' you would use something like: For i=1 to Data.Files.Count strPath=DataFiles(i) 'do something with strpath Next i Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Tuesday, October 27, 2009 6:53 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or 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 Oct 1 14:47:08 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 15:47:08 -0400 Subject: [dba-VB] MySQL Message-ID: <4AC5073C.5050102@colbyconsulting.com> I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- John W. Colby www.ColbyConsulting.com From max.wanadoo at gmail.com Thu Oct 1 14:59:28 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 1 Oct 2009 20:59:28 +0100 Subject: [dba-VB] [AccessD] MySQL In-Reply-To: <4AC5073C.5050102@colbyconsulting.com> References: <4AC5073C.5050102@colbyconsulting.com> Message-ID: <4ac50a3a.0707d00a.659c.2f57@mx.google.com> No, but you might want to do it with Virtual Box (free from Sun). Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 01 October 2009 20:47 To: Access Developers discussion and problem solving; VBA Subject: [AccessD] MySQL I am thinking of installing MySQL on my development laptop (vista), specifically to interface using c#, but I am wondering if it is easy to get Access to connect to MySQL? Any words of wisdom on: 1) The install under Vista? 2) Interfacing to c# 3) Interfacing to Access. -- 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 Thu Oct 1 20:03:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 Oct 2009 21:03:22 -0400 Subject: [dba-VB] SQL Server not locking up Message-ID: <4AC5515A.3070008@colbyconsulting.com> I am hesitantly declaring victory in the SQL Server war. I am going to award Nancy Lytle the award for the correct solution, with the proviso that she has to give it back if it turns out that the wily server misbehaves again. Since setting Max Degree of Parallelism to 3 I have not been locked out again. Understand that about this same time I also changed processor I/O affinity to only use the same three CPUs that I set CPU affinity for. And I have had so many problems with this, where it went away and then came back that I am very hesitant to declare victory but I did want to report back that the "locking up" issue hasn't recurred lately. Thanks go to everyone who volunteered suggestions. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 05:43:02 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 14:43:02 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: <002501ca4671$c8bfc420$5a3f4c60$@spb.ru> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From Gustav at cactus.dk Tue Oct 6 06:41:31 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 Oct 2009 13:41:31 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Tue Oct 6 07:37:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 Oct 2009 08:37:19 -0400 Subject: [dba-VB] Top 25 most dangerous programming errors Message-ID: <4ACB39FF.5030302@colbyconsulting.com> I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 6 13:32:50 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 6 Oct 2009 22:32:50 +0400 Subject: [dba-VB] Top 25 most dangerous programming errors In-Reply-To: <4ACB39FF.5030302@colbyconsulting.com> References: <4ACB39FF.5030302@colbyconsulting.com> Message-ID: <005e01ca46b3$6eccdb50$4c6691f0$@spb.ru> Hi John, Yes, that is a very useful site, thank you for sharing the link. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 06, 2009 4:37 PM To: Access Developers discussion and problem solving; VBA; Dba-Sqlserver Subject: [dba-VB] Top 25 most dangerous programming errors I just stumbled across this today. I'll be reading through them to see what i can learn. http://cwe.mitre.org/top25/ -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 13:45:00 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 19:45:00 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> Message-ID: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 6 15:35:40 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 00:35:40 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <4acb9040.0a04d00a.4cc3.7586@mx.google.com> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> Message-ID: <007701ca46c4$92e02d60$b8a08820$@spb.ru> Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From max.wanadoo at gmail.com Tue Oct 6 15:39:41 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 6 Oct 2009 21:39:41 +0100 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: <007701ca46c4$92e02d60$b8a08820$@spb.ru> References: <005a01ca46b3$6a20df70$3e629e50$@spb.ru> <4acb9040.0a04d00a.4cc3.7586@mx.google.com> <007701ca46c4$92e02d60$b8a08820$@spb.ru> Message-ID: <4acbab22.0a1ad00a.7ab2.40ff@mx.google.com> I just saw the headlines on that link I sent you. You will have to read through what is on offer. They do all sorts of things on all sorts of platforms for all sorts of systems. It is really just a pick-and-mix for whatever you need. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 21:36 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Max, Thank you for your feedback. "Unlimited traffic" is really unlimited or it just have a high limit? - I have heard this limit is 200GB/month. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 06, 2009 10:45 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil, www.1and1.co.uk is a German owned company selling heavily in the UK. http://order.1and1.co.uk/xml/order/Home;jsessionid=D7D3C0D248F5D6ED708FC8D7A CEEAAFF.TC31a?__reuse=1254854501574 they have an unlimited traffic offer at the moment. My company has been with them for about 10 years with no problems to speak of. Watch for wrap Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: 06 October 2009 19:33 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4483 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Oct 7 07:53:48 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 14:53:48 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Wed Oct 7 08:31:08 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 Oct 2009 17:31:08 +0400 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... In-Reply-To: References: Message-ID: <009501ca4752$6f1073c0$4d315b40$@spb.ru> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4486 (20091007) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 7 08:46:29 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 07 Oct 2009 15:46:29 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil I believe they offer all of the three common scenarios: 1. Hosted in a shared environment (virtual) where you cannot install anything special 2. Hosting of a dedicated server provided by you or your client, installed as you like 3. Hosting of a dedicated server supplied by Verinet for your exclusive use, remotely installed by you I'll ask when my contact replies about your options. And yes, that is the exchange rate. /gustav >>> shamil at smsconsulting.spb.ru 07-10-2009 15:31 >>> Gustav, Yes, I see: <<< PRISLISTE SERVER-HOSTING, COLOCATION, MICROSOFT HOSTING, LINUX HOSTING, CMS HOSTING M.V. SCT.PETERSBURG, RUSSIA / 1 Unit / 225 >>> Does this mean one custom PC server box co-located with their servers somewhere here in SPb? Should in such a case server box be purchased by the customers themselves or they (Verinet) provide this PC server box free when their service purchased? Not sure what currency is used in their service pricelist - is that: 225 Danish Krone = 44.51576 US Dollar (On Wednesday, October 7, 2009) per month? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 07, 2009 4:54 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil Yes I could do that. Bandwidth is really no problem for Verinet as they are housed at the DIX (Danish Internet Exchange). However, they have a co-hosting facility right in St. Petersborg: http://www.verinet.dk/server-hosting.htm I'll ask my contact what facility would be best for you. They are also present in Sweden where power charges are much lower than here. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri Oct 9 11:24:52 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 09 Oct 2009 12:24:52 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class Message-ID: <4ACF63D4.7090001@colbyconsulting.com> I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Oct 9 17:00:05 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 02:00:05 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4ACF63D4.7090001@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> Message-ID: <003601ca492b$dd700d50$985027f0$@spb.ru> Hi John, You can put your initialization code into your form constructor or Form_Load event processing method. BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP when programming on C# - and you'll feel a great relieve. Guaranteed/tested/proven by many developers. There are .NET natural naming conventions recommended by MS. Try to find and use them. Here is one source: http://www.irritatedvowel.com/Programming/Standards.aspx Here is a VS plug-in to help you get accustomed to the new naming conventions: http://www.codeplex.com/StyleCopForReSharper Although I haven't used it yet. --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 09, 2009 8:25 PM To: VBA Subject: [dba-VB] Error when passing controls to the constructor of a class I am very much a novice at C#. For my homework project I am trying to use classes (next semester stuff) and I have some processing that needs to manipulate controls back on the form. I have three instances of a Grades (plural) class which has to display the current grade, but only when a grade is added, deleted or modified in that specific instance. Additionally I have a set of controls on the form that are filled with data about all of the grades so the next level class (supervisor to clsGrades) has to update those controls. So I'm thinking I would create a clsGradesDisplay, instantiate two of this class up in the form, and pass in the four text boxes that have to be manipulated. Then I can pass that class off to the child classes so that they can manipulate the text boxes as they need to. This makes sense because those child classes actually contain the data that has to be displayed. ATM I simply pass the data back up the chain and have the form do the update, but it would be cleaner and less confusing to have the class that contains the data do the updates directly. My problem is that I get a compile error when I try to pass in the text boxes to the constructor of this clsGradesDisplay. The class constructor looks like this: class clsGradeDisplay { public TextBox txtGradeCnt; public TextBox txtGradeSum; public TextBox txtGradeAvg; public TextBox txtGradeWeightedAvg; /*Constructor - initializes the pointers to the text boxes */ public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, TextBox ltxtGradeAvg, TextBox ltxtGradeWeightedAvg) { txtGradeCnt = ltxtGradeCnt; txtGradeSum = ltxtGradeSum; txtGradeAvg = ltxtGradeAvg; txtGradeWeightedAvg = ltxtGradeWeightedAvg; } } Back in the header of the form I am tring to initialize the instances as follows: clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, txtSumOfGrades, txtAvgGrade, txtWeightedScore); The error is: Error 4 A field initializer cannot reference the non-static field, method, or property 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' It seems like it should work. I am allowed to initialize a class passing in values correct? Is there some special syntax for passing pointers to controls? What am I doing wrong? TIA, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4494 (20091009) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Sat Oct 10 08:35:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 10 Oct 2009 09:35:01 -0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <003601ca492b$dd700d50$985027f0$@spb.ru> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> Message-ID: <4AD08D85.5030308@colbyconsulting.com> Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > From shamil at smsconsulting.spb.ru Sat Oct 10 11:18:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 10 Oct 2009 20:18:53 +0400 Subject: [dba-VB] Error when passing controls to the constructor of a class In-Reply-To: <4AD08D85.5030308@colbyconsulting.com> References: <4ACF63D4.7090001@colbyconsulting.com> <003601ca492b$dd700d50$985027f0$@spb.ru> <4AD08D85.5030308@colbyconsulting.com> Message-ID: <000601ca49c5$5dfbabc0$19f30340$@spb.ru> Hi John -- Yes, it works well for me - programming without Hungarian notation in .NET development - they say Hungarian is not needed because you can always use Intellisense to see the type of variables etc. I still use Hungarian notation sometimes in control names, and always when naming MS SQL views, SPs, UDFs, triggers... As for inconsistency in MS internal code - I suppose they can't quit Hungarian notation habits overnight - but they are moving in the new direction for sure... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, October 10, 2009 5:35 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Error when passing controls to the constructor of a class Shamil, I have to say I wonder why the sudden distaste for Hungarian. I can see dropping the class thing since everything is now a class but the point of prefixing with the data type (str, int, dbl, dec etc) is to tell the programmer at a glance the data type so that they don't need to do anything to discover that. Why is it such a crime now to want to be able to read that instantly? Does it not work as well as it ever did? I find it amusing that the author recommends spelling everything out in full (no abbreviations) adding entire words to the end to denote specific types of constructs, dozens of new things to learn as a convention, yet Hungarian for the variables is verboten. And to top it all off, all this is "industry accepted standard naming conventions" EXCEPT for the fact that "they (Microsoft) aren't even consistent in their internal code in the .NET framework". Hmmmm........ John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > You can put your initialization code into your form constructor or Form_Load > event processing method. > > BTW, I see you still use Hungarian notation/LRNC - try to forget it ASAP > when programming on C# - and you'll feel a great relieve. > Guaranteed/tested/proven by many developers. There are .NET natural naming > conventions recommended by MS. Try to find and use them. Here is one source: > > http://www.irritatedvowel.com/Programming/Standards.aspx > > Here is a VS plug-in to help you get accustomed to the new naming > conventions: > > http://www.codeplex.com/StyleCopForReSharper > > Although I haven't used it yet. > > --Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 09, 2009 8:25 PM > To: VBA > Subject: [dba-VB] Error when passing controls to the constructor of a class > > I am very much a novice at C#. For my homework project I am trying to use > classes (next semester > stuff) and I have some processing that needs to manipulate controls back on > the form. I have three > instances of a Grades (plural) class which has to display the current grade, > but only when a grade > is added, deleted or modified in that specific instance. > > Additionally I have a set of controls on the form that are filled with data > about all of the grades > so the next level class (supervisor to clsGrades) has to update those > controls. > > So I'm thinking I would create a clsGradesDisplay, instantiate two of this > class up in the form, and > pass in the four text boxes that have to be manipulated. Then I can pass > that class off to the > child classes so that they can manipulate the text boxes as they need to. > This makes sense because > those child classes actually contain the data that has to be displayed. ATM > I simply pass the data > back up the chain and have the form do the update, but it would be cleaner > and less confusing to > have the class that contains the data do the updates directly. > > My problem is that I get a compile error when I try to pass in the text > boxes to the constructor of > this clsGradesDisplay. > > The class constructor looks like this: > > class clsGradeDisplay > { > public TextBox txtGradeCnt; > public TextBox txtGradeSum; > public TextBox txtGradeAvg; > public TextBox txtGradeWeightedAvg; > /*Constructor - initializes the pointers to the text boxes > */ > public clsGradeDisplay(TextBox ltxtGradeCnt, TextBox ltxtGradeSum, > TextBox ltxtGradeAvg, > TextBox ltxtGradeWeightedAvg) > { > txtGradeCnt = ltxtGradeCnt; > txtGradeSum = ltxtGradeSum; > txtGradeAvg = ltxtGradeAvg; > txtGradeWeightedAvg = ltxtGradeWeightedAvg; > } > } > > > Back in the header of the form I am tring to initialize the instances as > follows: > > clsGradeDisplay mGDCurrent = new clsGradeDisplay( txtCntOfGrades, > txtSumOfGrades, txtAvgGrade, > txtWeightedScore); > > > The error is: > > Error 4 A field initializer cannot reference the non-static field, > method, or property > 'Grade_Calculator.frmGradeCalculator.txtWeightedScore' > > It seems like it should work. I am allowed to initialize a class passing in > values correct? Is > there some special syntax for passing pointers to controls? > > What am I doing wrong? > > > TIA, > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4495 (20091010) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Mon Oct 12 21:35:07 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 12 Oct 2009 22:35:07 -0400 Subject: [dba-VB] C# serialization Message-ID: <4AD3E75B.2070006@colbyconsulting.com> I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Oct 12 22:29:00 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Tue, 13 Oct 2009 14:29:00 +1100 Subject: [dba-VB] C# serialization References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015824EA@ddi-01.DDI.local> Hi John, I did this a few years ago and the project got canned so beware :-). It only works with a single class at a time IIRC. Maybe LINQ to XML might be the way to go for building nested related objects? Just struggling through some of this myself, but I'm working from existing XML data. Look at creating XML trees. http://msdn.microsoft.com/en-us/library/bb387068.aspx good luck Michael M using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.IO; using System.Xml.Serialization; /// /// Serializes and deserializes Layout objects /// public class Serializer { public Serializer( ) { } /// /// Serializes the Layout object /// /// /// public void SerializeNow( string filePath, T source, SerializationFormat format ) { if ( source == null ) throw new ArgumentNullException( "source", "Invalid object to serialize" ); if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format ) { case SerializationFormat.Xml: // Insert code to set properties and fields of the object. XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); // To write to a file, create a StreamWriter object. using ( StreamWriter myWriter = new StreamWriter( "PedalMap.xml" ) ) { mySerializer.Serialize( myWriter, source ); myWriter.Close( ); } break; case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.OpenOrCreate, FileAccess.Write ) ) { BinaryFormatter b = new BinaryFormatter( ); b.Serialize( fs, source ); } break; } } /// /// Deserializes the Layout object /// /// /// public T DeSerializeNow( string filePath, SerializationFormat format ) { if ( string.IsNullOrEmpty( filePath ) ) throw new ArgumentException( "Invalid path" ); switch ( format) { case SerializationFormat.Binary: using ( FileStream fs = new FileStream( filePath, FileMode.Open, FileAccess.Read ) ) { BinaryFormatter b = new BinaryFormatter( ); try { return ( T ) b.Deserialize( fs ); } catch { return default( T ); } } case SerializationFormat.Xml: XmlSerializer mySerializer = new XmlSerializer( typeof( T ) ); using ( StreamReader myReader = new StreamReader( filePath ) ) return ( T ) mySerializer.Deserialize( myReader ); } return default( T ); } } The object to serialize, add the Serializable( ) attribute to the class. [Serializable( )] //Set this attribute to all the classes that want to serialize public class PedalMap { public PedalMap( ) { } //Add your properties here } You call it like so... Serializer s = new Serializer( ); s.SerializeNow( Application.ExecutablePath, _pmap, SerializationFormat.Xml ); -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 13 October 2009 1:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 13 09:54:36 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 07:54:36 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD3E75B.2070006@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: John, I'm not sure I understand what you're doing. Do these classes inherit typed datasets? If so, the parent class can easily return a child class that already contains a typed dataset of child records. You don't actually need collections for that. In that case, grade wouldn't need to be a class (although it could be, I just don't see any need). The Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, October 12, 2009 7:35 PM To: VBA Subject: [dba-VB] C# serialization I have a homework project in which I collect grades in clsgrade instances, in collection in clsGrades instances. I need to serialize / deserialize the clsGrade instances in the collection in each clsGrades instance. I actually did this a year or so ago in VB.Net but am not finding anything that results in a similar structure in c#. I managed to serialize a bunch but the results looked like: 100 1 99 1 As you can see I am getting a ton of header crap for each grade. I don't even have the code any more. Does anyone have simple code for serializing a strongly typed list full of class instances without serializing each instance manually? Then wrapping that in a higher level as well (the supervisor clsGrades)? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Oct 13 10:37:59 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:37:59 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> Message-ID: <4AD49ED7.5060300@colbyconsulting.com> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From cfoust at infostatsystems.com Tue Oct 13 10:39:40 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 08:39:40 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD49ED7.5060300@colbyconsulting.com> References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: You can build a typed dataset on an xml file John. Doesn't require a database. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:38 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child > class that already contains a typed dataset of child records. You > don't actually need collections for that. In that case, grade > wouldn't need to be a class (although it could be, I just don't see > any need). The > > Charlotte Foust From Gustav at cactus.dk Tue Oct 13 10:57:22 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 17:57:22 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Sounds like a quite normal database app to me ... If so, all the typed dataset stuff is ready at your hands. To persist (to an XML file without the overhead you claim about) use method WriteXml. To read it at load, use method ReadXml. Can't be simpler. Of course, I can see an educational purpose by handcrafting a kind of database, but ... /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> >Do these classes inherit typed datasets? Nope, no connection to a database. The original assignment was to build a grade calculator where you simply input a list of grades. There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of grade and DL 10% of grade). There is no requirement to do anything more than the above, calculating a total count of each grade type, sum of each type, average of each type and weighted average of each type, and then the same calculations for the totals. In order not to be bored to death, and with the approval of the instructor, I expanded the assignment to include using classes and collections. I store each grade in an instance of clsGrade. I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic collection into which the instances of clsGrade are inserted. This collection is strongly typed so that it can only accept clsGrade objects. Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which indexes into the collection to access the correct instance of clsGrades. Adding new grades, deleting grades and updating existing grades is all done on the selected instance of clsGrades. So... clsCalculator - interfaces to the form and has a sorted collection holding three instances of... clsGrades - contains a strongly typed generic collection holding multiple instances of ... clsGrade - contains each grade. clsGrades performs the calculations to count (collection.count), sum, average and weighted average all of the grades contained within. clsCalculator requests the various computed values from the three instances of clsGrades and performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), Average, weighted sum etc. Now... I want to write the grades in each clsGrades instance to a single file, then read it back in again. Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to do so. Please please please do not suggest a "better way" for doing the assignment, it is all written and functions exactly as you would expect it to work. You may of course enlighten me on different options, but I will not be rewriting the core assignment at this point. This was just a homework assignment and it is in fact finished. If I can persist it great, if not that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I am ahead of the curve at this point. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > I'm not sure I understand what you're doing. Do these classes inherit > typed datasets? If so, the parent class can easily return a child class > that already contains a typed dataset of child records. You don't > actually need collections for that. In that case, grade wouldn't need > to be a class (although it could be, I just don't see any need). The > > Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 10:59:49 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 11:59:49 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD3E75B.2070006@colbyconsulting.com> <4AD49ED7.5060300@colbyconsulting.com> Message-ID: <4AD4A3F5.5030509@colbyconsulting.com> That's nice Charlotte, but I assume that I would have to completely rewrite some level of how I do things. I would certainly welcome knowing how to do that but I don't want to do so at this moment. If this has anything to do with ADO and all of that stuff, I will be getting into that later. A year or so ago I used something similar to what I am doing now and just used serialization to write it out to a stream and later read it back in. I know from experience that once you are up to speed on the syntax of a language, it is easy to forget what a PITA all the nitpicking details are. I am still dealing with [] instead of () for the collections, explicit data type conversions and all the rest of the stuff that you don't even remember learning. "Building a typed dataset" of any kind is not where I am right now, never mind "on an XML file". Have patience Master. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > You can build a typed dataset on an xml file John. Doesn't require a > database. > > Charlotte > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 8:38 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply > input a list of grades. > There are three types of grades, each with a different weight (Tests - > 40% of grade, Labs - 50% of grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating > a total count of each grade type, sum of each type, average of each type > and weighted average of each type, and then the same calculations for > the totals. > > In order not to be bored to death, and with the approval of the > instructor, I expanded the assignment to include using classes and > collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) > which contains a generic collection into which the instances of clsGrade > are inserted. This collection is strongly typed so that it can only > accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in > clsCalculator, keyed on GradeType (keyed on the string "Test", "Lab" or > "DL"). In the main form there is a combo with three grade type strings > ("Test", "Lab" and "DL") which when selected is passed in to > clsCalculator which indexes into the collection to access the correct > instance of clsGrades. Adding new grades, deleting grades and updating > existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection > holding three instances of... > clsGrades - contains a strongly typed generic collection holding > multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, > average and weighted average all of the grades contained within. > > clsCalculator requests the various computed values from the three > instances of clsGrades and performs the calculations to create an > overall Count (sum of clsGrades.Count), Sum (sum of clsGrades.Sum), > Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, > then read it back in again. > Persist the grades to disk. I have no requirement to persist the data > to disk, I simply want to do so. > > Please please please do not suggest a "better way" for doing the > assignment, it is all written and functions exactly as you would expect > it to work. You may of course enlighten me on different options, but I > will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I > can persist it great, if not that's OK too. I have learned a lot and > thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a > "next semester" thing so I am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit > >> typed datasets? If so, the parent class can easily return a child >> class that already contains a typed dataset of child records. You >> don't actually need collections for that. In that case, grade >> wouldn't need to be a class (although it could be, I just don't see >> any need). The >> >> Charlotte Foust > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 13 11:13:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:13:13 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4A719.9090900@colbyconsulting.com> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Tue Oct 13 11:34:38 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 18:34:38 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi John Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). /gustav >>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust From jwcolby at colbyconsulting.com Tue Oct 13 11:43:39 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 12:43:39 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <4AD4AE3B.1010205@colbyconsulting.com> I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at > typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at > that level. > > I am quite sure that in a year I will be throwing out typed datasets with the best of them but right > now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav From cfoust at infostatsystems.com Tue Oct 13 12:10:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 13 Oct 2009 10:10:19 -0700 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4AE3B.1010205@colbyconsulting.com> References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: John, Typed datasets ARE serialized. That's the point. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 9:44 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization I am under the impression that you can write ANY repeating sequence such as these grade classes to XML and read them back rather easily, using serialization. However the only examples I am seeing are from back in 100, 2002, 2004. A lot has happened since then, so I figured to get modern examples of the same thing. Google is not being my friend ATM. As I said, I did this in VB, but cannot find my old code. I will certainly end up doing the database thing, but I want to get the basic C# syntax down before I go there. I am still thumbing through my book for the simplest little things. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Oh, I don't regard myself as a master in C# and you will probably learn something that is new to me. However, coming from Access, I went straight ahead for the database (dataset) stuff as I can see people are wasting endless hours writing primitive SqlCommand code as if nothing has happened since classic ASP or VB4. > > For very simple applications you may not need much more than your current task: write your values to an ini .. sorry xml file and read it back at the next launch. For this, no database engine is needed, not even Access/JET, but XML files fit nicely this purpose (and more). > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 18:13 >>> > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > LOL. Well, this is after a CLASS in C# the purpose of which is to > LEARN C#. You do not start at typed data sets, you start with "this > is a variable" and "this is a for loop". I am very much at that level. > > I am quite sure that in a year I will be throwing out typed datasets > with the best of them but right now I am still forgetting to put a ; at the end of the line. > > Have patience Master #2. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> Sounds like a quite normal database app to me ... >> >> If so, all the typed dataset stuff is ready at your hands. >> To persist (to an XML file without the overhead you claim about) use method WriteXml. >> To read it at load, use method ReadXml. Can't be simpler. >> >> Of course, I can see an educational purpose by handcrafting a kind of database, but ... >> >> /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Oct 13 13:19:30 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 13 Oct 2009 14:19:30 -0400 Subject: [dba-VB] C# serialization In-Reply-To: References: <4AD4AE3B.1010205@colbyconsulting.com> Message-ID: <4AD4C4B2.9020600@colbyconsulting.com> Charlotte, No, the point is that datasets are over my head at this point in the journey. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > John, > > Typed datasets ARE serialized. That's the point. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 13, 2009 9:44 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# serialization > > I am under the impression that you can write ANY repeating sequence such > as these grade classes to XML and read them back rather easily, using > serialization. However the only examples I am seeing are from back in > 100, 2002, 2004. A lot has happened since then, so I figured to get > modern examples of the same thing. Google is not being my friend ATM. > > As I said, I did this in VB, but cannot find my old code. > > I will certainly end up doing the database thing, but I want to get the > basic C# syntax down before I go there. I am still thumbing through my > book for the simplest little things. > > John W. Colby > www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Oct 13 14:26:44 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 13 Oct 2009 23:26:44 +0400 Subject: [dba-VB] C# serialization In-Reply-To: <4AD4A719.9090900@colbyconsulting.com> References: <4AD4A719.9090900@colbyconsulting.com> Message-ID: <003601ca4c3b$1a8cb190$4fa614b0$@spb.ru> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 13-10-2009 17:37 >>> > >Do these classes inherit typed datasets? > > Nope, no connection to a database. > > The original assignment was to build a grade calculator where you simply input a list of grades. > There are three types of grades, each with a different weight (Tests - 40% of grade, Labs - 50% of > grade and DL 10% of grade). > > There is no requirement to do anything more than the above, calculating a total count of each grade > type, sum of each type, average of each type and weighted average of each type, and then the same > calculations for the totals. > > In order not to be bored to death, and with the approval of the instructor, I expanded the > assignment to include using classes and collections. I store each grade in an instance of clsGrade. > I store all of each TYPE of grade in an instance of clsGrades (plural) which contains a generic > collection into which the instances of clsGrade are inserted. This collection is strongly typed so > that it can only accept clsGrade objects. > > Each instance of clsGrades (plural) is inserted into a sorted list in clsCalculator, keyed on > GradeType (keyed on the string "Test", "Lab" or "DL"). In the main form there is a combo with three > grade type strings ("Test", "Lab" and "DL") which when selected is passed in to clsCalculator which > indexes into the collection to access the correct instance of clsGrades. Adding new grades, > deleting grades and updating existing grades is all done on the selected instance of clsGrades. > > So... > > clsCalculator - interfaces to the form and has a sorted collection holding three instances of... > clsGrades - contains a strongly typed generic collection holding multiple instances of ... > clsGrade - contains each grade. > > clsGrades performs the calculations to count (collection.count), sum, average and weighted average > all of the grades contained within. > > clsCalculator requests the various computed values from the three instances of clsGrades and > performs the calculations to create an overall Count (sum of clsGrades.Count), Sum (sum of > clsGrades.Sum), Average, weighted sum etc. > > Now... > > I want to write the grades in each clsGrades instance to a single file, then read it back in again. > Persist the grades to disk. I have no requirement to persist the data to disk, I simply want to > do so. > > Please please please do not suggest a "better way" for doing the assignment, it is all written and > functions exactly as you would expect it to work. You may of course enlighten me on different > options, but I will not be rewriting the core assignment at this point. > > This was just a homework assignment and it is in fact finished. If I can persist it great, if not > that's OK too. I have learned a lot and thought I might learn how to do the persist thing, streams, > serialization (if that is used) etc. Even classes and collections are a "next semester" thing so I > am ahead of the curve at this point. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: >> John, >> >> I'm not sure I understand what you're doing. Do these classes inherit >> typed datasets? If so, the parent class can easily return a child class >> that already contains a typed dataset of child records. You don't >> actually need collections for that. In that case, grade wouldn't need >> to be a class (although it could be, I just don't see any need). The >> >> Charlotte Foust > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (part 1_ Message-ID: <004701ca4c41$9a7451a0$cf5cf4e0$@spb.ru> Hi John, The below approach and XmlArray attribute can be used for your sample/test case - the below posting didn't get dba-VB moderation on 20-SEP-09 : << Your mail to 'dba-VB' with the subject JSON and XML in memory serialization sample code Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 39406 bytes with a limit of 20 KB >> So I'm posting it here split into three parts: From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Sunday, September 20, 2009 6:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: JSON and XML in memory serialization sample code Hi All, Related to recent John post here (see P.S.) is a sample code of JSON and XML in memory serialization - how I do it usually. My question is do you know a way to implement XML in memory serialization using less code lines? I do use this XML code serialization for quite some time and I could have some new features, which could allow to simplify this code: Thank you. --Shamil P.S. Code sample - watch line wraps! - this code was nicely formatted here but when it will go through Internet it will get lines wrapped but anyway it should work - just edit comment lines and add references to System.Web and System.Web.Extensions assemblies: Continued in the next posting: From shamil at smsconsulting.spb.ru Tue Oct 13 15:13:11 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:13:11 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 2) Message-ID: <004201ca4c41$992b56e0$cb8204a0$@spb.ru> Continued. using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; using System.Web.Script.Serialization; namespace ConsoleApplication1 { [XmlType("phoneBookEntry")] public class PhoneBookEntry { [XmlAttribute("firstName")] public string FirstName {get;set;} [XmlAttribute("lastName")] public string LastName { get; set; } [XmlAttribute("phoneName")] public string Phone { get; set; } } class Program { static void Main(string[] args) { PhoneBookEntry entry = new PhoneBookEntry(); entry.FirstName = "Peter"; entry.LastName = "Brown"; entry.Phone = "+7-921-1234567"; JavaScriptSerializer js = new JavaScriptSerializer(); string jsEntry = js.Serialize(entry); Console.WriteLine("1. JSON string\n{0}", jsEntry); PhoneBookEntry[] entries = { entry, entry, entry }; string jsEntries = js.Serialize(entries); Console.WriteLine("1. JSON array\n{0}", jsEntries); string xmlEntry = InMemoryObjectsSerializer.Serialize(entry); Console.WriteLine("1. XML string\n{0}", xmlEntry); string xmlEntries = InMemoryObjectsSerializer.Serialize(entries); Console.WriteLine("1. XML array\n{0}", xmlEntries); } } To be continued in part 3. From shamil at smsconsulting.spb.ru Tue Oct 13 15:17:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:17:52 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.2) Message-ID: <004c01ca4c42$3f63fb70$be2bf250$@spb.ru> Continued (from 3.1). /// /// In memory object data serialization /// public class InMemoryObjectsSerializer { /// /// Cconverts a custom object instance to XML string /// /// Object that is to be serialized to XML /// XML string in UTF8 format public static String Serialize(Object pObject) { String XmlizedString = null; MemoryStream memoryStream = new MemoryStream(); XmlSerializer xs = new XmlSerializer(typeof(T)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); xs.Serialize(xmlTextWriter, pObject); memoryStream = (MemoryStream)xmlTextWriter.BaseStream; XmlizedString = StringToBytes.UTF8ByteArrayToString(memoryStream.ToArray()); return XmlizedString; } /// /// Reconstruct an object instance from XML string /// /// Xml string to be used for object instance deserialization /// public static Object Deserialize(String pXmlizedString) { XmlSerializer xs = new XmlSerializer(typeof(T)); MemoryStream memoryStream = new MemoryStream(StringToBytes.StringToUTF8ByteArray(pXmlizedString)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); return xs.Deserialize(memoryStream); } } } From shamil at smsconsulting.spb.ru Tue Oct 13 15:20:31 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 00:20:31 +0400 Subject: [dba-VB] FW: JSON and XML in memory serialization sample code (Part 3.1) Message-ID: <005601ca4c42$9dfc7180$d9f55480$@spb.ru> From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: Wednesday, October 14, 2009 12:13 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: FW: JSON and XML in memory serialization sample code (Part 3) Continued from Part 2. /// /// Converts strings to byte arrays and vice versa /// public class StringToBytes { /// /// Converts a Byte Array of Unicode values (UTF-8 encoded) to a complete String. /// /// Unicode Byte Array to be converted to String /// String converted from Unicode Byte Array public static String UTF8ByteArrayToString(Byte[] characters) { UTF8Encoding encoding = new UTF8Encoding(); String constructedString = encoding.GetString(characters); return (constructedString); } /// /// Converts the String to UTF8 Byte array and is used in De serialization /// /// /// public static Byte[] StringToUTF8ByteArray(String pXmlString) { UTF8Encoding encoding = new UTF8Encoding(); Byte[] byteArray = encoding.GetBytes(pXmlString); return byteArray; } } To be continued in Part 3.2.. From Gustav at cactus.dk Tue Oct 13 16:25:35 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 13 Oct 2009 23:25:35 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav From shamil at smsconsulting.spb.ru Tue Oct 13 17:28:47 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 14 Oct 2009 02:28:47 +0400 Subject: [dba-VB] C# serialization In-Reply-To: References: Message-ID: <005b01ca4c54$892d1f40$9b875dc0$@spb.ru> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, October 14, 2009 1:26 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# serialization Hi Shamil Thanks for the insight. But could you tell a bit of your reasons for not using datasets when you in your next post ask "do you know a way to implement XML in memory serialization using less code lines?" Don't get me wrong (that counts for JC as well) - I'm not on a mission for datasets - I just found them extremely convenient when I for a recent small project needed to read, list, and archive structured data as simple as possible using standardized methods (not reinventing anything) assuming I couldn't be the first on this planet having that need. With datasets I can design a table schema much the usual way with relations, referential integrity, autonumbers, required and/or unique fields etc. etc. - and write the whole stuff to an XML file with a single line of code. To me, this is one of the tools of VS which saves you much trouble and time. Of course, many cases can probably be listed where this is too limited but for quite a few projects the datasets will fill the bill. /gustav >>> shamil at smsconsulting.spb.ru 13-10-2009 21:26 >>> Hi John, You can use XMlArray attribute to define the name of XML group of serialized arrays, collections, lists,.. http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattribut es.xmlarray.aspx BTW, guys and gals, I'm programming on C# every day - I forgot when I last time used DataSets typed or not, well, that could be specifics of my subject area, but for example for a large ASP.NET site I developed, multi-layered with several thousands of custom classes etc. , DataSets were not used at all - and that large ASP.NET site is a business application with MS SQL 2005 backend... Just out of curiosity I have just checked DotNetNuke Community Edition 5.1.4 sources http://dotnetnuke.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33848 to find out how much times DataSet is used in these sources - here is my search result: === Matching lines: 22 Matching files: 5 Total files searched: 1414 === -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 13, 2009 8:13 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# serialization > Of course, I can see an educational purpose by handcrafting a kind of database, but ... LOL. Well, this is after a CLASS in C# the purpose of which is to LEARN C#. You do not start at typed data sets, you start with "this is a variable" and "this is a for loop". I am very much at that level. I am quite sure that in a year I will be throwing out typed datasets with the best of them but right now I am still forgetting to put a ; at the end of the line. Have patience Master #2. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Sounds like a quite normal database app to me ... > > If so, all the typed dataset stuff is ready at your hands. > To persist (to an XML file without the overhead you claim about) use method WriteXml. > To read it at load, use method ReadXml. Can't be simpler. > > Of course, I can see an educational purpose by handcrafting a kind of database, but ... > > /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4504 (20091013) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Wed Oct 14 02:52:03 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 09:52:03 +0200 Subject: [dba-VB] C# serialization Message-ID: Hi Shamil Thanks, I understand that now. /gustav >>> shamil at smsconsulting.spb.ru 14-10-2009 00:28 >>> Hi Gustav, Your example is good and approving complex DataSets's application for XML serialization/deserialization into/from XML files or in memory. What I meant was that AFAIS (and as I do) DataSets are rarely used in large enterprise level applications to communicate (CRUD, data retrieval) with backend databases. -- Shamil From jwcolby at colbyconsulting.com Wed Oct 14 12:37:15 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 13:37:15 -0400 Subject: [dba-VB] Merge / Purge Message-ID: <4AD60C4B.2030706@colbyconsulting.com> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Wed Oct 14 12:52:41 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 19:52:41 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John I would skip the update and delete parts as these are very slow. Instead, read/loop through the sorted table and append the single records to a new table. Thus: 1. Sort by name and "recenty" (what is the word for this, the most recent?) 2. Loop while collecting data for each name 3. For each name, append the collected and arranged data to the new (cleaned) table 4. Leave the old table as a backup I haven't worked with that many records so I cannot tell which coding method will turn out fastest. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to be FAST programming. Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have information about people, likes, uses, owns, income, etc. In a small percentage I have "duplicate" records except that the records are not duplicates per se but rather "belong to the same person", but have different information about likes, dislikes, uses, owns etc. It is impossible to rate the validity of any record over any other record. So I have three records about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese food and listens to the blues. The third record is also about John Colby, says he drives a Ford, doesn't mention drinks or eats, but says he listens to classical music. Again there is no way to rate the validity or even "most recentness" of the records. Now, I need to "merge" these records so that one single record says John Colby 1 Drinks Diet Pepsi 1 Drives Chevy 2 Eats Chinese 2 Listens Blues 3 Drives Ford 3 Listens Classical Merges into one record: Drinks Pepsi Drives Ford Eats Chinese Listens Classical OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the data from all the fields of all the records into one single record using the "most recent field wins" strategy. Every field in every record has to be examined. "Existing data" cannot be overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record position, NOT date (I don't have date info). As you can see, I cannot simply select one of the records and say that is the real data, I MUST merge all of the records, field by field. When I have one record with the "sum" of all the data in the multiple records, I write that record back out and delete the "other" records. There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two records for a single person, the maximum I have is about 15 records for a single person. So if there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many cases. In any case, it is a largish number of records, and a largish number of fields. My concept of what I would do is: 1) Open all records for a given person with dupes, probably in a recordset(?). 2) Use the fields collection to iterate through each field position. 3) Compare rec1 to recN in a loop for each field. 4) If data in the current field of the current record, write that data to the current field in record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. 5) Increment field. Go to 4) 6) Repeat until all fields compared 7) Increment record. Goto 3) 8) Repeat until all records compared to record 1 9) Save record1 back to the database 10) Delete record 2-N 11 Go to 1) 12 Repeat until all duplicates processed. So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. For speed reasons I am looking at doing this with C#. I could do this in short order in Access but I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn off multiple instances of this task so that my quad core machine could have as many as three of these processes running at any given time. I really have no clue how fast this would run so I have no clue whether I would need to do that but if I make it modular then perhaps I could do that if required. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Oct 14 13:05:50 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:05:50 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD612FE.5010107@colbyconsulting.com> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From Gustav at cactus.dk Wed Oct 14 13:19:23 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 14 Oct 2009 20:19:23 +0200 Subject: [dba-VB] Merge / Purge Message-ID: Hi John Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. /gustav >>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> Gustav, My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I do not understand the technology. The vision in my head says that once the records are pulled into a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory structure. I would think that doing the update there would be pretty fast. Once that first record was updated (in memory) with the values from all subsequent records, then write that updated (first) record back to the physical database and delete the subsequent records from the physical database. But what do I know? John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. From jwcolby at colbyconsulting.com Wed Oct 14 13:31:14 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:31:14 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD618F2.3080407@colbyconsulting.com> Further to this. I have a hash field which contains an SH1 hash for FName + LName + Addr + Zip5 + Zip4. These hash strings are absolutely unique (tested and confirmed) so what I am doing is pulling a view grouped by hash key where Count(PK) > 1. This gives me the data set of all hash keys of multiple ("dupes") records. In fact the hash key (and in fact all name / address fields) are out in a separate table related 1 to 1 with the fact table which I am "merging". Thus the hash would really pull a set of PKIDs which would be used to pull all of the fact records for the person that the hash key belongs to. Once those fact records are sitting in memory I would thing the update code would zip pretty well. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > I would skip the update and delete parts as these are very slow. > Instead, read/loop through the sorted table and append the single records to a new table. > > Thus: > 1. Sort by name and "recenty" (what is the word for this, the most recent?) > 2. Loop while collecting data for each name > 3. For each name, append the collected and arranged data to the new (cleaned) table > 4. Leave the old table as a backup > > I haven't worked with that many records so I cannot tell which coding method will turn out fastest. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> > I have a problem that AFAICT is going to have to be attacked with programming, and it will need to > be FAST programming. > > Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have > information about people, likes, uses, owns, income, etc. > > In a small percentage I have "duplicate" records except that the records are not duplicates per se > but rather "belong to the same person", but have different information about likes, dislikes, uses, > owns etc. > > It is impossible to rate the validity of any record over any other record. So I have three records > about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is > about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese > food and listens to the blues. The third record is also about John Colby, says he drives a Ford, > doesn't mention drinks or eats, but says he listens to classical music. > > Again there is no way to rate the validity or even "most recentness" of the records. > > Now, I need to "merge" these records so that one single record says > > John Colby > > 1 Drinks Diet Pepsi > 1 Drives Chevy > 2 Eats Chinese > 2 Listens Blues > 3 Drives Ford > 3 Listens Classical > > Merges into one record: > > Drinks Pepsi > Drives Ford > Eats Chinese > Listens Classical > > OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the > data from all the fields of all the records into one single record using the "most recent field > wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > position, NOT date (I don't have date info). > > As you can see, I cannot simply select one of the records and say that is the real data, I MUST > merge all of the records, field by field. When I have one record with the "sum" of all the data in > the multiple records, I write that record back out and delete the "other" records. > > There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two > records for a single person, the maximum I have is about 15 records for a single person. So if > there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform > this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many > cases. > > In any case, it is a largish number of records, and a largish number of fields. My concept of what > I would do is: > > 1) Open all records for a given person with dupes, probably in a recordset(?). > 2) Use the fields collection to iterate through each field position. > 3) Compare rec1 to recN in a loop for each field. > 4) If data in the current field of the current record, write that data to the current field in > record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in > CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. > 5) Increment field. Go to 4) > 6) Repeat until all fields compared > 7) Increment record. Goto 3) > 8) Repeat until all records compared to record 1 > 9) Save record1 back to the database > 10) Delete record 2-N > 11 Go to 1) > 12 Repeat until all duplicates processed. > > So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" > or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. > > For speed reasons I am looking at doing this with C#. I could do this in short order in Access but > I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn > off multiple instances of this task so that my quad core machine could have as many as three of > these processes running at any given time. I really have no clue how fast this would run so I have > no clue whether I would need to do that but if I make it modular then perhaps I could do that if > required. > From jwcolby at colbyconsulting.com Wed Oct 14 13:39:10 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:39:10 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61ACE.6030707@colbyconsulting.com> You are right of course but I am thinking the update would just fly. There are about 550 fields in the fact table. Thus I would be comparing / updating 550 fields, sequentially, between Rec1 and Rec2. Then Rec2 / Rec3, Rec1 / Rec4 etc until all fact records for a given hash key (person) are finished. The "facts" can be anything from strings of 20-30 bytes down to a simple "Y". The vast majority of fields contain "Y" or nothing. A small minority contain codes ('A' - 'T') for example. And a very small number contain somewhat longer strings. This is not a transaction database so there will be no locking contentions etc. Just me and my update program whistling away. I will be working on a copy of the main table of course. Maybe writing modified (Record1) to one table and deleted (Records 2-N) to another table. At the end do the deletes / inserts. It probably will pay to copy all of the duplicate fact records out to a temp table and work on that as the source table. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 14 13:41:03 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 14:41:03 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: Message-ID: <4AD61B3F.8000409@colbyconsulting.com> This is exactly the kind of stuff that I am taking my class for. C# is so much more faster / powerful than VBA in this kind of processing. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi John > > Yes, you may be right, except that the amount of data is so big. But again, I can't tell for sure. > However, my method is so plain simple that in any case I would try that first. If speed shows up as an issue you can easily expand to follow your scheme. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-10-2009 20:05 >>> > Gustav, > > My thought was that I would be doing this in a disconnected ADO recordset. However as we all know I > do not understand the technology. The vision in my head says that once the records are pulled into > a disconnected recordset then the data is sitting in memory in some kind of .NET / ADO in memory > structure. I would think that doing the update there would be pretty fast. Once that first record > was updated (in memory) with the values from all subsequent records, then write that updated (first) > record back to the physical database and delete the subsequent records from the physical database. > > But what do I know? > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi John >> >> I would skip the update and delete parts as these are very slow. >> Instead, read/loop through the sorted table and append the single records to a new table. >> >> Thus: >> 1. Sort by name and "recenty" (what is the word for this, the most recent?) >> 2. Loop while collecting data for each name >> 3. For each name, append the collected and arranged data to the new (cleaned) table >> 4. Leave the old table as a backup >> >> I haven't worked with that many records so I cannot tell which coding method will turn out fastest. >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 14-10-2009 19:37 >>> >> I have a problem that AFAICT is going to have to be attacked with programming, and it will need to >> be FAST programming. >> >> Imagine I have a table with tens of millions of records, hundreds of fields. In this table I have >> information about people, likes, uses, owns, income, etc. >> >> In a small percentage I have "duplicate" records except that the records are not duplicates per se >> but rather "belong to the same person", but have different information about likes, dislikes, uses, >> owns etc. >> >> It is impossible to rate the validity of any record over any other record. So I have three records >> about John Colby, one says he drinks diet Pepsi, and drives a Chevy. The next "duplicate" record is >> about John Colby but doesn't have any info about drinks or drives but has info about eats Chinese >> food and listens to the blues. The third record is also about John Colby, says he drives a Ford, >> doesn't mention drinks or eats, but says he listens to classical music. >> >> Again there is no way to rate the validity or even "most recentness" of the records. >> >> Now, I need to "merge" these records so that one single record says >> >> John Colby >> >> 1 Drinks Diet Pepsi >> 1 Drives Chevy >> 2 Eats Chinese >> 2 Listens Blues >> 3 Drives Ford >> 3 Listens Classical >> >> Merges into one record: >> >> Drinks Pepsi >> Drives Ford >> Eats Chinese >> Listens Classical >> >> OK, I have solved the problem of selecting every record for John Colby. Now I need to "merge" the >> data from all the fields of all the records into one single record using the "most recent field >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record >> position, NOT date (I don't have date info). >> >> As you can see, I cannot simply select one of the records and say that is the real data, I MUST >> merge all of the records, field by field. When I have one record with the "sum" of all the data in >> the multiple records, I write that record back out and delete the "other" records. >> >> There are millions of duplicates (about 3 million out of 50 million IIRC). In some cases I have two >> records for a single person, the maximum I have is about 15 records for a single person. So if >> there are 3 million "dupes" I will have a maximum of 1.5 million "merge operations" where I perform >> this merge process. In fact it will be somewhat fewer because there are more than 2 dupes in many >> cases. >> >> In any case, it is a largish number of records, and a largish number of fields. My concept of what >> I would do is: >> >> 1) Open all records for a given person with dupes, probably in a recordset(?). >> 2) Use the fields collection to iterate through each field position. >> 3) Compare rec1 to recN in a loop for each field. >> 4) If data in the current field of the current record, write that data to the current field in >> record 1. Notice that ACTUAL DATA in CurrentField.CurrentRec overwrites data in >> CurrentField.Record1 in every case. OTOH, No data in CurrentField.CurrentRec, no update. >> 5) Increment field. Go to 4) >> 6) Repeat until all fields compared >> 7) Increment record. Goto 3) >> 8) Repeat until all records compared to record 1 >> 9) Save record1 back to the database >> 10) Delete record 2-N >> 11 Go to 1) >> 12 Repeat until all duplicates processed. >> >> So that is the overview. This is where all the Masters are invited to chime in with "use a dataset" >> or "use this other technology", as well as WHY, and where possible pointers to example code or whatever. >> >> For speed reasons I am looking at doing this with C#. I could do this in short order in Access but >> I am afraid that the speed would be abysmal. Also I want to be able to use threads perhaps to spawn >> off multiple instances of this task so that my quad core machine could have as many as three of >> these processes running at any given time. I really have no clue how fast this would run so I have >> no clue whether I would need to do that but if I make it modular then perhaps I could do that if >> required. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Wed Oct 14 14:51:07 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 15 Oct 2009 05:51:07 +1000 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD61B3F.8000409@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com> Message-ID: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> John, > >> wins" strategy. Every field in every record has to be examined. "Existing data" cannot be > >> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is defined by record > >> position, NOT date (I don't have date info). SQL Server doesn't have a concept of chronological record position. Unless there is atimestamp or incrementing field, there is no way to know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. Do use have an incrementing key field? Stuart McLachlan From jwcolby at colbyconsulting.com Wed Oct 14 15:19:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 16:19:54 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> References: , <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> Message-ID: <4AD6326A.4080708@colbyconsulting.com> Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. Unless there is > atimestamp or incrementing field, there is no way to know which is the most recent entry or > to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From cfoust at infostatsystems.com Wed Oct 14 16:20:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Wed, 14 Oct 2009 14:20:42 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6326A.4080708@colbyconsulting.com> References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: Unless they have data in the same fields. Then what happens? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 14, 2009 1:20 PM To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Merge / Purge Stuart, Yes there is a PKID. The thing is, every record is equal so it simply doesn't matter in which order the records are pulled. Any of the duplicates can be treated as the first record to be updated by whatever is found in the subsequent records. It literally doesn't matter which record is encountered first. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > John, > >>>> wins" strategy. Every field in every record has to be examined. >>>> "Existing data" cannot > be >>>> overwritten by "no data" but MUST be overwritten by "most recent >>>> data". Recent is > defined by record >>>> position, NOT date (I don't have date info). > > SQL Server doesn't have a concept of chronological record position. > Unless there is atimestamp or incrementing field, there is no way to > know which is the most recent entry or to guarantee that the most recent will be the "last" record in the recordset selected. > > Do use have an incrementing key field? > > > Stuart McLachlan > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 14 22:18:19 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 14 Oct 2009 23:18:19 -0400 Subject: [dba-VB] Merge / Purge In-Reply-To: References: , <4AD61B3F.8000409@colbyconsulting.com><4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> Message-ID: <4AD6947B.8090807@colbyconsulting.com> Charlotte, > Unless they have data in the same fields. Then what happens? Well, so what? Either overwrite or don't. Remember it is impossible to tell which is correct. They can't BOTH be correct. Flip a coin and do something, it literally doesn't matter what. John Colby Owns_A_Dog = 'Y' John Colby Owns_A_Dog = 'N' Which one is true? We have no way to say one record is more recent so flip a coin and merge the data. In fact in most cases (90% of all the fields) the data is "Y" or nothing. These records are the result of people taking polls. So in 90% of the cases, the person will answer "Y" or they have no answer because they weren't asked that question in that poll. The objective here is to get a ton of individual poll responses merged into a single record. I did a count earlier today and one person is in the database 36 times, 26 times, 17, 16, two 14s, four 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million total records). So when I try to ask the question "income bracket in (A-T)" and ("Owns a dog" OR "owns a cat") AND "mail order buyer", I end up with cases where "Owns a dog" was answered in one record and "mail order buyer" was answered in another record. So the AND fails whereas in fact the person answered affirmatively to both questions, just not in the same record. This is nuts. I need to merge things down so that there is a single record for a single person. ALL ANSWERS need to be in one record. If there are conflicting records, flip a coin, pick one answer. Now before you go off on normalization and a single column fact table, just remember that I have 50 million records X 550 columns. A single column fact table would end up with 25 Tera records and I don't have a supercomputer. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Unless they have data in the same fields. Then what happens? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 14, 2009 1:20 PM > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > related programming issues. > Subject: Re: [dba-VB] Merge / Purge > > Stuart, > > Yes there is a PKID. The thing is, every record is equal so it simply > doesn't matter in which order the records are pulled. Any of the > duplicates can be treated as the first record to be updated by whatever > is found in the subsequent records. > > It literally doesn't matter which record is encountered first. > > John W. Colby > www.ColbyConsulting.com From dbdoug at gmail.com Wed Oct 14 22:30:51 2009 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 14 Oct 2009 20:30:51 -0700 Subject: [dba-VB] Merge / Purge In-Reply-To: <4AD6947B.8090807@colbyconsulting.com> References: <4AD61B3F.8000409@colbyconsulting.com> <4AD62BAB.5667.11018703@stuart.lexacorp.com.pg> <4AD6326A.4080708@colbyconsulting.com> <4AD6947B.8090807@colbyconsulting.com> Message-ID: <4dd71a0c0910142030vb19034fh7e316528476dcbca@mail.gmail.com> On Wed, Oct 14, 2009 at 8:18 PM, jwcolby wrote: > Charlotte, > > > Unless they have data in the same fields. Then what happens? > > Well, so what? Either overwrite or don't. Remember it is impossible to > tell which is correct. > They can't BOTH be correct. Flip a coin and do something, it literally > doesn't matter what. > > John Colby Owns_A_Dog = 'Y' > John Colby Owns_A_Dog = 'N' > > Which one is true? We have no way to say one record is more recent so flip > a coin and merge the data. > > In fact in most cases (90% of all the fields) the data is "Y" or nothing. > These records are the > result of people taking polls. So in 90% of the cases, the person will > answer "Y" or they have no > answer because they weren't asked that question in that poll. > > The objective here is to get a ton of individual poll responses merged into > a single record. I did > a count earlier today and one person is in the database 36 times, 26 times, > 17, 16, two 14s, four > 13s etc. 3,080,470 "duplicate" person fact records (out of 50 million > total records). > > So when I try to ask the question "income bracket in (A-T)" and ("Owns a > dog" OR "owns a cat") AND > "mail order buyer", I end up with cases where "Owns a dog" was answered in > one record and "mail > order buyer" was answered in another record. So the AND fails whereas in > fact the person answered > affirmatively to both questions, just not in the same record. This is > nuts. I need to merge things > down so that there is a single record for a single person. ALL ANSWERS > need to be in one record. > If there are conflicting records, flip a coin, pick one answer. > > Now before you go off on normalization and a single column fact table, just > remember that I have 50 > million records X 550 columns. A single column fact table would end up > with 25 Tera records and I > don't have a supercomputer. > > John W. Colby > www.ColbyConsulting.com > > > Charlotte Foust wrote: > > Unless they have data in the same fields. Then what happens? > > > > Charlotte Foust > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Wednesday, October 14, 2009 1:20 PM > > To: stuart at lexacorp.com.pg; Discussion concerning Visual Basic and > > related programming issues. > > Subject: Re: [dba-VB] Merge / Purge > > > > Stuart, > > > > Yes there is a PKID. The thing is, every record is equal so it simply > > doesn't matter in which order the records are pulled. Any of the > > duplicates can be treated as the first record to be updated by whatever > > is found in the subsequent records. > > > > It literally doesn't matter which record is encountered first. > > > > John W. Colby > > www.ColbyConsulting.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dwaters at usinternet.com Thu Oct 15 17:56:00 2009 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 15 Oct 2009 17:56:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Message-ID: I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan From shamil at smsconsulting.spb.ru Fri Oct 16 06:24:20 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 15:24:20 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 07:16:46 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 08:16:46 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <4AD8642E.6020103@colbyconsulting.com> It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Oct 16 07:26:53 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 16:26:53 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD8642E.6020103@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> Message-ID: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Hi John, Thank you for your remark. 1 form/report times 2.5 works rather well provided existing functionality is preserved. For new projects 1 (final) form/report times 4 is a better ballpark figure. This is software development industry wide experience. It doesn't matter what framework etc. is used. BTW, your framework could be relatively easy ported to .NET, I suppose. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 4:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? It also depends on many other things. For example if you were to convert one of my projects you would be facing my framework and tons of classes and modules. That stuff might just convert but maybe not. How about DAO specific code in modules? I reference databases, recordsets, fields, even properties of fields, I use dynamic queries modifying TDFs in code, I build dynamic SQL and execute it with the database object. I have error logging, login logging, usage of forms logging. I control access to forms and controls on forms based on user/group/usergroup security, manipulating Enabled, Locked and Visible properties based on the user rights. I control subform loading based on whether a ton of controls two forms up have valid data in them, allowing supervisors to override but not normal users. Also what BE are you going to? SQL Server? Staying with an MDB? How about VBA functions embedded in queries? Are you moving from DAO bound to ADO unbound? Are you setting a DAO recordset to the form's recordset clone and then doing stuff behind the scenes? I am now using pass through queries to pull data from SQL Server views. How about import / export of data? My applications strip files off of email and download from FTP sites, and even watch directories, then convert to / from CSV and fixed width files, importing and exporting to tables. I have table driven code which builds fixed width reports with header and footer information based on mainframe specs provided by banks and insurance companies. Your formula would probably work if the original was written by a power user (or summer intern in the case of NorthWind). I would be VERY hesitant to make a firm quote on such a rule of thumb. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hello Dan, > > I'd count it as one form/report => 1 day => times 2.5 = that would include > all project costs not only development. > But if you do not plan to change any functionality then it can be done > quicker - here is a real life conversion case's stats online: > > http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 > > The estimations were between 45 and 165 hours - just for conversion > development work - average estimation was exactly around the final figure: > ~65 hours for 35 forms/reports (with subforms/sureports). Final result is > not "industry strong" - it would need another 60 hours to make it "industry > strong", even more time would be needed to write docs and online help if > needed etc. - all in all it will be 1 day for 1 form/report for such a > simple application... > > Of course it also depends on how experienced your developers are, what > architecture your converted system is planned to have etc. > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 08:16:51 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 09:16:51 -0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> Message-ID: <4AD87243.8080200@colbyconsulting.com> Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Thank you for your remark. > > 1 form/report times 2.5 works rather well provided existing functionality is > preserved. For new projects 1 (final) form/report times 4 is a better > ballpark figure. This is software development industry wide experience. It > doesn't matter what framework etc. is used. BTW, your framework could be > relatively easy ported to .NET, I suppose. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 4:17 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? > > It also depends on many other things. For example if you were to convert > one of my projects you > would be facing my framework and tons of classes and modules. That stuff > might just convert but > maybe not. How about DAO specific code in modules? I reference databases, > recordsets, fields, even > properties of fields, I use dynamic queries modifying TDFs in code, I build > dynamic SQL and execute > it with the database object. > > I have error logging, login logging, usage of forms logging. I control > access to forms and controls > on forms based on user/group/usergroup security, manipulating Enabled, > Locked and Visible properties > based on the user rights. I control subform loading based on whether a ton > of controls two forms up > have valid data in them, allowing supervisors to override but not normal > users. > > Also what BE are you going to? SQL Server? Staying with an MDB? How about > VBA functions embedded > in queries? Are you moving from DAO bound to ADO unbound? Are you setting > a DAO recordset to the > form's recordset clone and then doing stuff behind the scenes? I am now > using pass through queries > to pull data from SQL Server views. > > How about import / export of data? My applications strip files off of email > and download from FTP > sites, and even watch directories, then convert to / from CSV and fixed > width files, importing and > exporting to tables. I have table driven code which builds fixed width > reports with header and > footer information based on mainframe specs provided by banks and insurance > companies. > > Your formula would probably work if the original was written by a power user > (or summer intern in > the case of NorthWind). I would be VERY hesitant to make a firm quote on > such a rule of thumb. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: >> Hello Dan, >> >> I'd count it as one form/report => 1 day => times 2.5 = that would include >> all project costs not only development. >> But if you do not plan to change any functionality then it can be done >> quicker - here is a real life conversion case's stats online: >> >> http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 >> >> The estimations were between 45 and 165 hours - just for conversion >> development work - average estimation was exactly around the final figure: >> ~65 hours for 35 forms/reports (with subforms/sureports). Final result is >> not "industry strong" - it would need another 60 hours to make it > "industry >> strong", even more time would be needed to write docs and online help if >> needed etc. - all in all it will be 1 day for 1 form/report for such a >> simple application... >> >> Of course it also depends on how experienced your developers are, what >> architecture your converted system is planned to have etc. >> >> Thank you. >> >> -- >> Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > > > __________ Information from ESET NOD32 Antivirus, version of virus signature > database 4514 (20091016) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.esetnod32.ru > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 08:57:25 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 17:57:25 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <4AD87243.8080200@colbyconsulting.com> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <4AD8642E.6020103@colbyconsulting.com> <006b01ca4e5b$f3c2f0b0$db48d210$@spb.ru> <4AD87243.8080200@colbyconsulting.com> Message-ID: <006f01ca4e68$989fdf60$c9df9e20$@spb.ru> Hi John, You can use DAO in C#/VB.NET, although you can't bind forms/reports (MSReportViewerControl) to DAO recordsets therefore yes, DAO has to be removed I suppose. But if you're so "sticky" (:) kidding) to DAO you can model/simulate it via ADO.NET. It shouldn't be a big issue to create wrapper classes simulating DAO (the DAO features you use - this subset is rather limited I expect) but using ADO.NET, and then that wrapper classes can have properties, which can be bound to e.g. WinForms... WithEvents is everywhere in .NET - you'll feel OK with that. WinForms events do differ from MS Access forms' ones but you can find good equivalents I suppose. All in all I still suppose that conversion of your framework to .NET wouldn't be a complicated task - I'd propose to do that conversion not literally but conceptually - preserving your framework's principles/concepts/architecture but substituting (and not trying to simulate) technologies as DAO with the .NET native ones... I must also note that nowadays (in the near future with release of .NET Framework 4.0/VS 2010) we will get so powerful framework from MS that developing custom frameworks would become an overkill... <<< Microsoft kindly gave us the DAO object model and I know it (and program it) very well. >>> Well, DAO forced so many developers to think too straightforward navigational way, and it (DAO) was developed the time when it was already clear for many years that a one working with relational databases should better use "set thinking" approach - it was a real PITA to use DAO all that years, how many "spaghetti" code was developed because of that... In .NET as I noted already in another thread here for enterprise level apps and small businesses custom apps when programming against backend DBs are that MS Access or MS SQL ones - you usually need just a few - I'd count less than ten classes and methods of ADO.NET. Yes, I understand in your framework you make many run-time dynamic SQL-scripts generation - you will not need that in .NET - but if you'll need you can use NHibernate for dynamic objects/SQL or many code generation tools for static objects/SQL generation etc. - and I'd rely solely on ADO.NET Entity Framework starting .NET Framework v.4.0 ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 5:17 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Shamil, My framework probably would not be trivial to port because it programs the DAO model to the metal. DAO exposes all of the MDB to the programmer and I manipulate LOTS of MDB stuff. Since you are throwing out the MDB you have to hand convert all of that code to something else. Let's take one small example. I have a framework that loads a class for a form. Each form class automatically loads a class for each control, specific to that control type. Each control class knows how to do things specific to it's ACCESS control capabilities. Text box classes do text box things, combo classes do combo things, tab control classes do tab control things. When my bound form loads, each text box control class instance drills down into it's bound field looking for the data type. To do this it uses the recordset clone and starts accessing the field collection to get its field, the properties collection of the field to get the data type. If it is a date it asks the framework for and applies a standard date format to the control. That code is DAO specific, i.e. it would have to be looked at and manually converted. That is one of about a thousand similar things that I do. Thanks entirely to you I use WithEvents extensively. I sink all of the form's events in the control class (though I don't process every single event of course). I do extensive processing in OnLoad and OnCurrent, BeforeUpdate and AfterUpdate inside of clsFrm. I have control classes for each control type and they sink and process many different text box events, combo events, button events. Are all of these events identical for VB? Is what they would do identical in VB? Is the method of turning on the event identical in VB? My framework is not a library of functions, it is an Access FE specific operating system that loads when the project loads. It loads SysVars that control every aspect of the framework operation, and allows me to selectively modify that operation on a form by form basis. It loads a form class when any form loads, the form class loads control classes for every control as the form loads. It performs standard processing automatically and programmatically. I use the double click event of a combo to load a form that exposes the list of objects in the combo, moves to the record displayed by the combo and allows the user to edit that record (or any other if they wish), refreshing the combo when the form closes. I modify the label back color to cue the user that the dbl-click works. All of that kind of functionality is embedded in the framework and I program in the form's OnLoad what form to open, what mode the form opens in etc. It takes me one line of code to program this dbl-click for a given combo on a given form. The framework uses DAO to do all of that. If you move to VB then DAO is going away right? That means manual conversion of all of that code. You assume that "existing functionality" means it loads / displays and saves data. "Power user" stuff. I assume that there are many experienced programmers out there that go waaaaaaaaaaaaaayyyyyyyy beyond Northwind. Microsoft kindly gave us the DAO object model and I know it (and program it) very well. This is one of my frustrations with the .Net system - while it can do all that and more, it does it very differently. Translating what I do now in Access to .Net is NOT a trivial task. Someday I will be able to do all of this and more in .Net but it is not a straightforward port. Every single DAO reference has to be translated. Whoever ports a complex Access application must be VERY experienced in .Net as well as Access. How many .Net programmers do you know that are VERY experienced in Access (or even want to admit it is more than a toy!)? Sounds like a niche market for us eh? ;) John W. Colby www.ColbyConsulting.com <<< snipped >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From dwaters at usinternet.com Fri Oct 16 09:09:59 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 09:09:59 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Fri Oct 16 11:00:26 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 09:00:26 -0700 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: Just be aware that conversion tools do splendidly if what they're converting is fairly straight-forward objects and code. They fall in a heap over complex subforms and subreports. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 7:10 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 16 12:56:52 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 16 Oct 2009 21:56:52 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru> <5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> Message-ID: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Fri Oct 16 13:27:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 14:27:05 -0400 Subject: [dba-VB] Threads and stuff Message-ID: <4AD8BAF9.4070304@colbyconsulting.com> I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Fri Oct 16 15:00:20 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 16 Oct 2009 13:00:20 -0700 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: Are you declaring the properties shared? Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 11:27 AM To: VBA Subject: [dba-VB] Threads and stuff I am trying to figure out threads. My biggest question has to do with static declarations. It appears that the thread initialization requires a static method to call. I have a class which will start an external program / process. This process hangs the thread it runs on until the external program closes or the ProcessStartInfo times out at which point ProcessStartInfo shuts down the external process. It is this thing that I am trying to do in a thread. I thought I would build a class, the class would contain all the thread stuff, set up the thread, start the thread etc. Thus I could simply instantiate the class, pass in the program to run, and call a start() method to cause the class' own thread to run the process. I got all of that working but... the static function that the thread runs is not visible from outside of the class if the class is instantiated. That was unexpected. I understand that a static function is designed to allow calling it without instantiating the class, however it makes sense to me to instantiate the class once for each program instance I want to run. The thread that runs the program instance belongs to the class instance that opens the program instance. Am I deluded? Anyway, because the class method that the thread runs has to be static, all of the class properties (name of the program to open etc) have to be static. I really want to initialize the class and manually call the same function that the thread will call but it seems that static and non-static cannot talk to each other. IOW I had to copy and paste the static method to another non-static method and call the non-static method from the calling class. Even inside of my class I couldn't call the non-static method from inside of the static method. Every property and method reference from inside of the static method had to be declared static as well. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 16 15:06:16 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 16 Oct 2009 15:06:16 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 16 15:33:05 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 16 Oct 2009 16:33:05 -0400 Subject: [dba-VB] Threads and stuff In-Reply-To: References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <4AD8D881.8050103@colbyconsulting.com> Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Oct 16 15:40:12 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 17 Oct 2009 00:40:12 +0400 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: <005401ca4e53$35a94be0$a0fbe3a0$@spb.ru><5ED8B346696F4F0E87B6E4DC49C3BECD@danwaters> <008601ca4e8a$0bbefdc0$233cf940$@spb.ru> Message-ID: <008a01ca4ea0$ddae6c10$990b4430$@spb.ru> Hi Dan, OK, that sounds good - a good candidate application for automated conversion I mean :) 50KB of code isn't that much to clean-up after automated conversion but it's important to know what this code does? For example, once in the very beginning of my .NET development practice I have got converted advanced MS Excel VB6 COM add-in with about 10,000-15,000(?) code lines into VB.NET COM add-in - conversion of VB6 code into VB.NET is a built-in feature of Visual Studio but after that conversion I have spent about three days to make the converted code up & running, and I have got all that add-in functionality working OK. That add-in code didn't use database and if your code is like that - i.e. it is mainly utility/business layer functionality without that much db communication and without a lot of built-in SQL then clean-up of 50KB of code lines after automatic conversion could be done in max. 15 days. You can try to use the tools you mentioned with Northwind db - and I (and maybe somebody else also here) can have a look on the results of automatic conversion, and then we can tell more clearly how good this automatic conversion is. I'd note that the companies who sell such conversion tools do usually have rather limited evaluation versions - if such evaluation version will not be able to process NorthWind sample app (do they have it already processed as sa ample?) maybe you can contact them directly and ask to run the full version against Northwind and send you the converted result for evaluation. It's not an issue IMO for evaluation that converted app will have MS Access BE because the main part of work of your app conversion is currently expected to be forms/reports + code conversion... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Saturday, October 17, 2009 12:06 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, The project I want to convert is actually mine, which I license to four long-term customers in my area (Minneapolis). Each customer's system has lots of additions so it does what they want it to do. To keep things running well, all trapped code errors are recorded and automatically sent to me the next morning. So after several years of working through these, I think my code is pretty well written. It's pretty standard, the queries don't use custom functions, forms and reports are bound to a table or a query, and I don't think I do anything tricky. There are about 50K lines of code that are involved. I don't expect to have a tool return anything more than a starting point. But if this becomes a 500 hour project, then any time savings is a good thing! Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 12:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, In general I do not believe that automated conversion tools can do good job - I mean that after running automated conversion you'll get up & running application. I can be wrong. (I tried in the past some automated conversion tools - they weren't satisfactory). The quality of work of such tools IMO severely depends on the quality of the source code, and e.g. Gustav's code should get converted well, JC's code should also get converted well but his code specifics are that he uses a lot of "tricks" and "outdated" technologies features as DAO so automated conversion will not be of that much help here etc. I quoted here Gustav's code and JC's code because I have seen their code snippets here many times - unfortunately the main volume of VBA/VB6 code base AFAIHS is far from that quality... I have seen also "incredibly" badly designed forms/reports, which customers expected to get converted to .NET "overnight" - no way to do that I suppose... So if your code and forms/reports are of quality of Gustav and JC, and you do not use that much "tricky" programming as JC does, and you do not have a lot of inline SQL, and your forms and reports are mainly bound, and your SQL in queries is rather clean and doesn't use custom functions, and you do not use macros, and you do not use a lot of MS Access specific DoCmd... and RunCommand etc. - then I'd suppose you have good chances to get a converted app which will compile (after some(?) manual fixes) and which will even get some features working... Still just guessing here - if you have this MS Access -> .NET conversion project and there is no other options - just go for it - find good consultants/developers, purchase the tools you believe should do the work for you, make first trial conversion to get converted project compiled and maybe running some features - you can get quotes for that first phase - just select the most attractive ones. When that first phase finished you'll know more. You can also get some code converted during the first phase, which can be immediately used in production - that would be approval of the costs of the first conversion phase, then if first phase will succeed go for the second phase again setting clear customer business attractive goals etc. - do not try to eat this "behemoth" at once - it could happen you can succeed in that "big lunch eating" but you'll know that only when you'll make ... All in all IMO .NET (+ MS SQL backend) development is a way easier than that of VB6/VBA but learning curve is longer... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 6:10 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hi Shamil, This is exactly what I was hoping would be available! Great! I have a direct conversion project with 175 forms/reports. Most are simple but some are complex. I also have 89 standard modules/class modules. SQL Server 2005 will contain the BE. So, this is a lot of work. I did find 2 software utility tools which will do conversion of objects in Access to objects in VB.Net. 1) http://www.microtools.us/ this is $160. 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. If either even works fairly well, that would be the way to go. These both have demo versions so if someone wants to try them out and report back that would be helpful. I don't know enough of VB.Net yet to make a good assessment. Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, October 16, 2009 6:24 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? Hello Dan, I'd count it as one form/report => 1 day => times 2.5 = that would include all project costs not only development. But if you do not plan to change any functionality then it can be done quicker - here is a real life conversion case's stats online: http://northwind.codeplex.com/Thread/View.aspx?ThreadId=54924 The estimations were between 45 and 165 hours - just for conversion development work - average estimation was exactly around the final figure: ~65 hours for 35 forms/reports (with subforms/sureports). Final result is not "industry strong" - it would need another 60 hours to make it "industry strong", even more time would be needed to write docs and online help if needed etc. - all in all it will be 1 day for 1 form/report for such a simple application... Of course it also depends on how experienced your developers are, what architecture your converted system is planned to have etc. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 16, 2009 2:56 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? I know some of you have done this!? Do you have any general rules of thumb on how long the conversion or rewriting took you? Thanks! Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From michael at ddisolutions.com.au Sun Oct 18 17:47:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 19 Oct 2009 09:47:17 +1100 Subject: [dba-VB] Threads and stuff References: <4AD8BAF9.4070304@colbyconsulting.com> <4AD8D881.8050103@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D01582518@ddi-01.DDI.local> Hi John, I havn't delved deeply into the threading model in .net. I have used the background worker object from time to time though. The way that works is using events to pass data to and from your threaded class. It's always worked well for my modest needs. That said, will the 'volatile' keyword help you? Cheers Michael M Yes. I have to in order for the shared method to see them. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > Are you declaring the properties shared? > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 16, 2009 11:27 AM > To: VBA > Subject: [dba-VB] Threads and stuff > > I am trying to figure out threads. My biggest question has to do with > static declarations. It appears that the thread initialization requires > a static method to call. > > I have a class which will start an external program / process. This > process hangs the thread it runs on until the external program closes or > the ProcessStartInfo times out at which point ProcessStartInfo shuts > down the external process. It is this thing that I am trying to do in a > thread. I thought I would build a class, the class would contain all > the thread stuff, set up the thread, start the thread etc. Thus I could > simply instantiate the class, pass in the program to run, and call a > start() method to cause the class' own thread to run the process. I got > all of that working but... the static function that the thread runs is > not visible from outside of the class if the class is instantiated. > That was unexpected. I understand that a static function is designed to > allow calling it without instantiating the class, however it makes sense > to me to instantiate the class once for each program instance I want to > run. The thread that runs the program instance belongs to the class > instance that opens the program instance. > Am I deluded? > Anyway, because the class method that the thread runs has to be static, > all of the class properties (name of the program to open etc) have to be > static. I really want to initialize the class and manually call the > same function that the thread will call but it seems that static and > non-static cannot talk to each other. IOW I had to copy and paste the > static method to another non-static method and call the non-static > method from the calling class. Even inside of my class I couldn't call > the non-static method from inside of the static method. Every property > and method reference from inside of the static method had to be declared > static as well. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Oct 19 00:44:23 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 19 Oct 2009 09:44:23 +0400 Subject: [dba-VB] Threads and stuff In-Reply-To: <4AD8BAF9.4070304@colbyconsulting.com> References: <4AD8BAF9.4070304@colbyconsulting.com> Message-ID: <00d601ca507f$38e682e0$aab388a0$@spb.ru> <<< Anyway, because the class method that the thread runs has to be static >>> Hi John, Threads can run on instance methods - here is just a quick sample - no static methods used at all except console app's entry method: using System; using System.Threading; namespace ConsoleApplication1 { public class ThreadRunner { private int _threadNum; public ThreadRunner(int threadNum) { _threadNum = threadNum; } public void Run() { Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} started, Id = {2}", DateTime.Now, _threadNum, Thread.CurrentThread.ManagedThreadId); Thread.Sleep(1100 - _threadNum*100 ); Console.WriteLine("{0:HH:mm.ss.fff}: Thread#{1} finished.", DateTime.Now, _threadNum); } } public class ThreadManager { public void StartThreads() { for (int i = 1; i<=10; i++) { Thread th = new Thread(RunThread); th.Start(new ThreadRunner(i)); } } public void RunThread(object threadRunner) { ThreadRunner tr = (ThreadRunner)threadRunner; tr.Run(); } } class Program { static void Main(string[] args) { (new ThreadManager()).StartThreads(); } } } Here is output this sample produces: 09:41.53.519: Thread#3 started, Id = 5 09:41.53.519: Thread#1 started, Id = 3 09:41.53.522: Thread#4 started, Id = 6 09:41.53.524: Thread#5 started, Id = 7 09:41.53.520: Thread#2 started, Id = 4 09:41.53.524: Thread#6 started, Id = 8 09:41.53.524: Thread#7 started, Id = 9 09:41.53.524: Thread#8 started, Id = 10 09:41.53.524: Thread#9 started, Id = 11 09:41.53.524: Thread#10 started, Id = 12 09:41.53.625: Thread#10 finished. 09:41.53.724: Thread#9 finished. 09:41.53.824: Thread#8 finished. 09:41.53.924: Thread#7 finished. 09:41.54.024: Thread#6 finished. 09:41.54.124: Thread#5 finished. 09:41.54.223: Thread#4 finished. 09:41.54.323: Thread#3 finished. 09:41.54.424: Thread#2 finished. 09:41.54.523: Thread#1 finished. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 16, 2009 10:27 PM To: VBA Subject: [dba-VB] Threads and stuff .... Anyway, because the class method that the thread runs has to be static ... -- John W. Colby www.ColbyConsulting.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4520 (20091018) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Mon Oct 19 05:13:46 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 19 Oct 2009 12:13:46 +0200 Subject: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Message-ID: Hi Shamil My contact has been on vacation. He'll forward me some info later today which I will forward to you off-line. He confirms that hosting, indeed traffic, may be quite expensive in Russia. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 20:32 >>> Hi Gustav, Thank you for your feedback. Does http://www.verinet.dk/serverhosting.htm have some information in English for me to understand the options they have? <<< It could be interesting to see what solution your client decides for. >>> OK, this is a start-up - the traffic I mentioned is planned to be in the future, hopefully, next spring/summer, but you know... Let's see how it will evolve, and if it will evolve successfully I will write about their web site and solution here... <<< I could arrange for a specified offer if you are interested. >>> Thank you. Do you mean you can request http://www.verinet.dk/serverhosting.htm for a free quote of their service costs for planned by my customer MS Windows, ASP.NET, MS SQL Server + large (500GB) disk space hosting? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 06, 2009 3:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] ASP.NET site "hungry" for disk space and traffic... Hi Shamil One option is AWS, though the cost could be more the USD 300/month if you need more CPU power. However, you can scale the CPU up and down during the day or week: http://aws.amazon.com/windows/ For a "Large instance" (7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform) cost would be about USD 457/month including traffic (an power): http://calculator.s3.amazonaws.com/calc5.html Another option - at least here - is Verinet, a major player: http://www.verinet.dk/serverhosting.htm who offers top-speed transfer at very low cost. Also, they offer to deliver dedicated hardware at prices not even the distributors can compete with: http://www.verinet.dk/rackhosting-serverhosting-rackserver.htm I could arrange for a specified offer if you are interested. It could be interesting to see what solution your client decides for. /gustav >>> shamil at smsconsulting.spb.ru 06-10-2009 12:43 >>> Hi All, I'm working here on an ASP.NET project (real estate related), which potentially could get allocated 500GB of hard disk space, and could have 200-400GB traffic per month: this site is planned to store pictures and video clips. I'm wondering what hosting option is the most appropriate (/less expensive) for such an application? I guess that should be a physical PC (or even two - second as a media stream server) installed on ISP side, or are there any virtual hosting available for ASP.NET application under development, which will cost within, say, USD300/month for 500GB disk space and 200-400GB of traffic per month? I thought I could "split" my application to have program and database part running on relatively inexpensive ASP.NET hosting site, and pictures and video clips stored on another (virtual) server, and uploaded and downloaded/transmitted from there - AFAIU in that latter case of using a separate server for pictures/videos the traffic for their transmission to the user will not be accounted as part of traffic of my ASP.NET site? Thank you. -- Shamil From raibeart at gmail.com Mon Oct 19 20:31:00 2009 From: raibeart at gmail.com (Robert Stewart) Date: Mon, 19 Oct 2009 20:31:00 -0500 Subject: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? In-Reply-To: References: Message-ID: <4add12d6.0ac0100a.3a77.520b@mx.google.com> From what I am reading, Access Whiz Options: First Option Price Bundle Price A- Access to VB .NET (Web Application): ANETVB $169.00 $60.00 B- Access to VB .NET (Windows Application): ANETVB8 $169.00 $60.00 C- Access to VB6 (Windows Application): AccessToVB6 $94.00 $40.00 D- Access to C# (Web Application) ANETVC $169.00 $60.00 E- Access to Crystal Reports 8 or later: AccessToCR $169.00 $60.00 F- Access Form Controls to VB .NET: ANETVBF $45.00 $25.00 G- Access Form Controls to C# .NET: ANETVCF $45.00 $25.00 H- Access to C# (Windows Application): ANETVC7 $169.00 $60.00 Looks like it would cost me: D - $169 E - $ 60 G - $ 25 ______ $254 To be able to do a complete conversion, plus the cost of Crystal. On the second one, the link is broken to the 2003 databases, and it only converts to VB6. I think they are a bit too far behind the times to be very useful. I will take a look at the first one and let the list know back what I think about it. I think my code is pretty good and standard. So, it should not be that difficult for the program to convert it to C#. I have a project about double the size of yours to convert to ASP.net. So a tool like this might be very useful. In looking at the download page when they send it to you, System Requirements Supported Operating Systems: Windows 2000; Windows Server 2003; Windows Server 2008; Windows Vista; Windows XP Required Software: Access 2000 or later; Full version of Crystal Reports RDC, Report Designer Component 8 or later is required for AccessToCR, Access Whiz Option E; Microsoft .NET Framework SDK 1.x or 2.0 is required for Access Whiz Options A, B, D, F, G and H Display: 1024 x 768 high color I am not sure how helpful .Net 2.0 is going to be when I am doing everything in 3.5 SP1. Also, notice that The full version of Crystal Reports RDC is required to do the report conversions. You might also want to take a look at their FAQ page. There seems to be a lot it does not do. At 12:00 PM 10/16/2009, you wrote: >Date: Fri, 16 Oct 2009 09:09:59 -0500 >From: "Dan Waters" >Subject: Re: [dba-VB] Access FE --> VB: Conversion/Rewrite Time? >To: "'Discussion concerning Visual Basic and related programming > issues.'" >Message-ID: <5ED8B346696F4F0E87B6E4DC49C3BECD at danwaters> >Content-Type: text/plain; charset="iso-8859-1" > >Hi Shamil, > >This is exactly what I was hoping would be available! Great! > >I have a direct conversion project with 175 forms/reports. Most are simple >but some are complex. I also have 89 standard modules/class modules. SQL >Server 2005 will contain the BE. So, this is a lot of work. > >I did find 2 software utility tools which will do conversion of objects in >Access to objects in VB.Net. > > 1) http://www.microtools.us/ this is $160. > 2) http://members.shaw.ca/irie/vbobjconverter.htm this is $250. > >If either even works fairly well, that would be the way to go. > >These both have demo versions so if someone wants to try them out and report >back that would be helpful. I don't know enough of VB.Net yet to make a >good assessment. > >Thanks! >Dan From jwcolby at colbyconsulting.com Tue Oct 20 10:45:20 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 11:45:20 -0400 Subject: [dba-VB] C# replace a special character Message-ID: <4ADDDB10.4010703@colbyconsulting.com> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue Oct 20 11:21:32 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 20 Oct 2009 18:21:32 +0200 Subject: [dba-VB] C# replace a special character Message-ID: Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From drawbridgej at sympatico.ca Tue Oct 20 11:27:20 2009 From: drawbridgej at sympatico.ca (Jack and Pat) Date: Tue, 20 Oct 2009 12:27:20 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Tue Oct 20 11:33:44 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:33:44 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: I think the overhead of RegEx would be too high on a really large replace. It works great, but it isn't the fastest way. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com From cfoust at infostatsystems.com Tue Oct 20 11:34:42 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 Oct 2009 09:34:42 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Except the for the semicolon, that's the way to do it in VB.Net too. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, October 20, 2009 9:22 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav From marklbreen at gmail.com Tue Oct 20 12:39:06 2009 From: marklbreen at gmail.com (Mark Breen) Date: Tue, 20 Oct 2009 18:39:06 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: Hello John, I used the following SQL today, and it works a treat, in my case, I wanted to exclude all except alphas, I know that it is not C#, and I know you may prefer C# as practice, so if it is no useful, just bin it. I got the code from this site, if you have a look, there is a little more there that you may be able to make use of. Thanks to Nigel Rivett. http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html WHILE @@rowcount > 0 UPDATE tablename SET columnname = REPLACE(columnname, SUBSTRING(columnname, PATINDEX('%[^a-zA-Z0-9]%', columnname), 1), '') WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 Mark 2009/10/20 Charlotte Foust > Except the for the semicolon, that's the way to do it in VB.Net too. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Tuesday, October 20, 2009 9:22 AM > To: dba-vb at databaseadvisors.com > Subject: Re: [dba-VB] C# replace a special character > > Hi John > > You should be able to use the Replace method directly on your string > holding the line or the file: > > theStringToCleanUp.Replace(((char)26).ToString(),""); > > like: > > string contents = File.ReadAllText(path); > File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Tue Oct 20 12:47:02 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 10:47:02 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Just a minor note: Even in that small piece of code there is an error. It reads: string output = Regex.Replace(input, "N.t", "NET"); ...but it should read: string output = Regex.Replace(input, "Not", "NET"); Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Jack and Pat Sent: Tuesday, October 20, 2009 9:27 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character John, I did a google search to find this link. I'm not a C# person, but thought I'd pass this on http://dotnetperls.com/regex-replace-1 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 11:45 AM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Tue Oct 20 12:54:31 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 18:54:31 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: Message-ID: <4addf97f.0c11660a.320f.1168@mx.google.com> Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Tue Oct 20 13:10:50 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:10:50 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <952D1092F8714F1EABF4E6A7B887402B@creativesystemdesigns.com> Message-ID: <9347022991EF4B13A31B779024041F56@creativesystemdesigns.com> I have no idea how fast this 'search and replace' product is but according to a friend, it is a great little product for searching non indexed hard drives... far faster than Windows own indexing, according to him. http://www.inforapid.de/html/searchreplace.htm HTH Jim From accessd at shaw.ca Tue Oct 20 13:29:11 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 20 Oct 2009 11:29:11 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4addf97f.0c11660a.320f.1168@mx.google.com> References: <4addf97f.0c11660a.320f.1168@mx.google.com> Message-ID: <17B53F39615F4A1BB67C69C33BE5CBB3@creativesystemdesigns.com> STREAMING would be even faster... I switched some ADO code from CHUNK picture data retrieval to ADO to Stream, a number of years ago, on a project and the transfer rate was on an order of magnitude faster. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, October 20, 2009 10:55 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Gustav, What about getting CHUNKS at a time and doing the replace en-bloc. That should speed things up? Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 20 October 2009 17:22 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Hi John You should be able to use the Replace method directly on your string holding the line or the file: theStringToCleanUp.Replace(((char)26).ToString(),""); like: string contents = File.ReadAllText(path); File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); /gustav >>> jwcolby at colbyconsulting.com 20-10-2009 17:45 >>> I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Oct 20 14:49:26 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 Oct 2009 23:49:26 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADDDB10.4010703@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> Message-ID: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Hi John, Try this code snippet changing input and output files' paths: int bufferSize = 1024*1024; string inputFile = @"c:\temp\inputFile.txt"; string outputFile = @"c:\temp\outputFile.txt"; System.IO.FileStream inputStream = new System.IO.FileStream( inputFile, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None, bufferSize); System.IO.FileStream outputStream = new System.IO.FileStream( outputFile, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None, bufferSize); byte[]data = new byte[bufferSize]; int offset = 0; int totalLength = 0; int length = 0; while ((length = inputStream.Read(data, offset, bufferSize)) > 0) { totalLength += length; string text = System.Text.Encoding.ASCII.GetString(data); text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; data = System.Text.Encoding.ASCII.GetBytes(text); outputStream.Write(data, offset, length); } inputStream.Close(); outputStream.Close(); Console.WriteLine("Total length test: {0}", totalLength); HTH. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, October 20, 2009 7:45 PM To: VBA Subject: [dba-VB] C# replace a special character I have a file which contains a sprinkling of a special character - decimal 26, hex 1A (the SUB character). This special character in the CSV file output to Accuzip causes Accuzip to hiccup. In order to get on with my life I need to pre-process the files to get rid of this special character. Because of the size of these files (hundreds of mbytes) I need to do a readline / replace / writeline kind of thing. I think I need to use the stringbuilder.replace but I do not know how to specify replacing this hex 1A with something else. The something else would ideally be nothing (empty string) but can be any valid alpha character (A, B etc). Can anyone help me with this replace part of the problem. C# syntax please. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4527 (20091020) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From jwcolby at colbyconsulting.com Tue Oct 20 14:53:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:53:22 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> Message-ID: <4ADE1532.2000109@colbyconsulting.com> It is my guess that Regex will be too slow. This will be a file with about 100 characters average per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but reading in 200 million bytes all at once could cause issues. John W. Colby www.ColbyConsulting.com Jack and Pat wrote: > John, > > I did a google search to find this link. I'm not a C# person, but thought > I'd pass this on > > http://dotnetperls.com/regex-replace-1 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 11:45 AM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From jwcolby at colbyconsulting.com Tue Oct 20 14:56:33 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 15:56:33 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADE15F1.1050803@colbyconsulting.com> Thanks Mark. Doing it inside SQL Server is the ideal for sure. ATM I only have the issue in the Address field of the typical FName, LName, Addr, City, St, Zip5, Zip4 record. Thinking about it though you could conceivably have this issue in any field. I will definitely check this out though. John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Oct 20 15:00:53 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 20 Oct 2009 16:00:53 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com> <016f01ca51be$6f4a8030$4ddf8090$@spb.ru> Message-ID: <4ADE16F5.6030600@colbyconsulting.com> Thanks Shamil! John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Try this code snippet changing input and output files' paths: > > int bufferSize = 1024*1024; > > string inputFile = @"c:\temp\inputFile.txt"; > string outputFile = @"c:\temp\outputFile.txt"; > > System.IO.FileStream inputStream = > new System.IO.FileStream( > inputFile, > System.IO.FileMode.Open, > System.IO.FileAccess.Read, > System.IO.FileShare.None, > bufferSize); > System.IO.FileStream outputStream = > new System.IO.FileStream( > outputFile, > System.IO.FileMode.Create, > System.IO.FileAccess.Write, > System.IO.FileShare.None, > bufferSize); > > byte[]data = new byte[bufferSize]; > int offset = 0; > int totalLength = 0; > int length = 0; > while ((length = inputStream.Read(data, offset, bufferSize)) > 0) > { > totalLength += length; > > string text = System.Text.Encoding.ASCII.GetString(data); > text = text.Replace((char)26, ' ').Replace((char)0x1a,' ') ; > data = System.Text.Encoding.ASCII.GetBytes(text); > > outputStream.Write(data, offset, length); > } > > inputStream.Close(); > outputStream.Close(); > > Console.WriteLine("Total length test: {0}", totalLength); > > HTH. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, October 20, 2009 7:45 PM > To: VBA > Subject: [dba-VB] C# replace a special character > > I have a file which contains a sprinkling of a special character - decimal > 26, hex 1A (the SUB > character). This special character in the CSV file output to Accuzip causes > Accuzip to hiccup. In > order to get on with my life I need to pre-process the files to get rid of > this special character. > Because of the size of these files (hundreds of mbytes) I need to do a > readline / replace / > writeline kind of thing. I think I need to use the stringbuilder.replace > but I do not know how to > specify replacing this hex 1A with something else. The something else would > ideally be nothing > (empty string) but can be any valid alpha character (A, B etc). > > Can anyone help me with this replace part of the problem. C# syntax please. > From stuart at lexacorp.com.pg Tue Oct 20 16:28:39 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 21 Oct 2009 07:28:39 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE1532.2000109@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP>, <4ADE1532.2000109@colbyconsulting.com> Message-ID: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> 200 megabytes tirivial. I just knocked this up in PowerBasic (this is the complete program!): #COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG LOCAL strFile AS STRING LOCAL lngSTart AS LONG LOCAL strData AS STRING strFile = "ML_Data.mdb" lngStart = TIMER OPEN strFile FOR BINARY AS #1 GET$ #1, LOF(1), strData CLOSE #1 REPLACE "A" WITH "B" IN strData OPEN strfile & "fixed" FOR BINARY as#1 PUT$ #1, strData CLOSE #1 MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" END FUNCTION It compiles to an 11KB executable with no dependencies. It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of that time was taken in reading and writing the file to/from memory. -- Stuart On 20 Oct 2009 at 15:53, jwcolby wrote: > It is my guess that Regex will be too slow. This will be a file with about 100 characters average > per line, 2 million lines. Doing this in one big read MIGHT be possible (and I will try) but > reading in 200 million bytes all at once could cause issues. > > John W. Colby > www.ColbyConsulting.com > > > Jack and Pat wrote: > > John, > > > > I did a google search to find this link. I'm not a C# person, but thought > > I'd pass this on > > > > http://dotnetperls.com/regex-replace-1 > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Tuesday, October 20, 2009 11:45 AM > > To: VBA > > Subject: [dba-VB] C# replace a special character > > > > I have a file which contains a sprinkling of a special character - decimal > > 26, hex 1A (the SUB > > character). This special character in the CSV file output to Accuzip causes > > Accuzip to hiccup. In > > order to get on with my life I need to pre-process the files to get rid of > > this special character. > > Because of the size of these files (hundreds of mbytes) I need to do a > > readline / replace / > > writeline kind of thing. I think I need to use the stringbuilder.replace > > but I do not know how to > > specify replacing this hex 1A with something else. The something else would > > ideally be nothing > > (empty string) but can be any valid alpha character (A, B etc). > > > > Can anyone help me with this replace part of the problem. C# syntax please. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From max.wanadoo at gmail.com Tue Oct 20 17:12:19 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Tue, 20 Oct 2009 23:12:19 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: What if the input line wont fit into memory? max On 20/10/2009, Stuart McLachlan wrote: > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > >> It is my guess that Regex will be too slow. This will be a file with >> about 100 characters average >> per line, 2 million lines. Doing this in one big read MIGHT be possible >> (and I will try) but >> reading in 200 million bytes all at once could cause issues. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> Jack and Pat wrote: >> > John, >> > >> > I did a google search to find this link. I'm not a C# person, but >> > thought >> > I'd pass this on >> > >> > http://dotnetperls.com/regex-replace-1 >> > >> > -----Original Message----- >> > From: dba-vb-bounces at databaseadvisors.com >> > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> > Sent: Tuesday, October 20, 2009 11:45 AM >> > To: VBA >> > Subject: [dba-VB] C# replace a special character >> > >> > I have a file which contains a sprinkling of a special character - >> > decimal >> > 26, hex 1A (the SUB >> > character). This special character in the CSV file output to Accuzip >> > causes >> > Accuzip to hiccup. In >> > order to get on with my life I need to pre-process the files to get rid >> > of >> > this special character. >> > Because of the size of these files (hundreds of mbytes) I need to do a >> > readline / replace / >> > writeline kind of thing. I think I need to use the >> > stringbuilder.replace >> > but I do not know how to >> > specify replacing this hex 1A with something else. The something else >> > would >> > ideally be nothing >> > (empty string) but can be any valid alpha character (A, B etc). >> > >> > Can anyone help me with this replace part of the problem. C# syntax >> > please. >> > >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Oct 21 08:56:21 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 09:56:21 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF1305.1090809@colbyconsulting.com> Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); >> File.WriteAllText(path, contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Jay.Hunnicutt at med.navy.mil Wed Oct 21 09:25:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 10:25:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF1305.1090809@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: John, If you make it a SQL Scalar function you can use it to strip characters for select, Update and insert statements as needed. Makes it a little easier to use as well as reusable. CREATE FUNCTION F_DropSpecChar ( -- Add the parameters for the function here @S varchar(100) ) RETURNS varchar(100) AS BEGIN -- Declare the return variable here DECLARE @Result varchar(100) DECLARE @i INTEGER select @i = patindex('%[^a-zA-Z0-9 ]%', @s) while @i > 0 begin select @s = replace(@s, substring(@s, @i, 1), '') select @i = patindex('%[^a-zA-Z0-9 ]%', @s) end SELECT @Result = @S -- Return the result of the function RETURN @Result END GO Query: select dbo.F_DropSpecChar('qh*(*^&$^1234') Returns: qh1234 Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 9:56 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character Mark, This performs an update on an existing column in an existing table simply by specifying the tablename / column name? John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I > wanted to exclude all except alphas, I know that it is not C#, and I > know you may prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little > more there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark > > > 2009/10/20 Charlotte Foust > >> Except the for the semicolon, that's the way to do it in VB.Net too. >> >> Charlotte Foust >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >> Brock >> Sent: Tuesday, October 20, 2009 9:22 AM >> To: dba-vb at databaseadvisors.com >> Subject: Re: [dba-VB] C# replace a special character >> >> Hi John >> >> You should be able to use the Replace method directly on your string >> holding the line or the file: >> >> theStringToCleanUp.Replace(((char)26).ToString(),""); >> >> like: >> >> string contents = File.ReadAllText(path); File.WriteAllText(path, >> contents.Replace(((char)26).ToString(),"")); >> >> /gustav >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:09:22 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:09:22 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> Message-ID: <4ADF2422.7060204@colbyconsulting.com> I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes it > a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Oct 21 10:23:43 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:23:43 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: Message-ID: <4ADF277F.60802@colbyconsulting.com> Mark, Below is the SP I created to perform this magic. I will be running this on 66 million records so we shall see about performance. set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: -- Create date: -- Description: -- --WHILE @@rowcount > 0 -- UPDATE tablename -- SET columnname = REPLACE(columnname, -- SUBSTRING(columnname, -- PATINDEX('%[^a-zA-Z0-9]%', -- columnname), 1), '') -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 -- -- ============================================= ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] -- Add the parameters for the stored procedure here @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @SQL varchar(1000) declare @PatIndex varchar(50) BEGIN TRY set @PatIndex = '%[^a-zA-Z0-9 .,#]%' SELECT @SQL = 'WHILE @@rowcount > 0 UPDATE ' + @DBName + '.dbo.' + @TblName + ' SET ' + @FldName + ' = REPLACE(' + @FldName + ', SUBSTRING(' + @FldName + ', PATINDEX(''' + @PatIndex + ''', ' + @FldName + '), 1), '''') WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' exec (@SQL) print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName END TRY BEGIN CATCH print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName print @SQL print ERROR_MESSAGE() END CATCH END John W. Colby www.ColbyConsulting.com Mark Breen wrote: > Hello John, > I used the following SQL today, and it works a treat, in my case, I wanted > to exclude all except alphas, I know that it is not C#, and I know you may > prefer C# as practice, so if it is no useful, just bin it. > > I got the code from this site, if you have a look, there is a little more > there that you may be able to make use of. > > Thanks to Nigel Rivett. > > http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > > > > WHILE @@rowcount > 0 > UPDATE tablename > SET columnname = REPLACE(columnname, > SUBSTRING(columnname, > PATINDEX('%[^a-zA-Z0-9]%', > columnname), 1), '') > WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > > > > Mark From Jay.Hunnicutt at med.navy.mil Wed Oct 21 10:28:58 2009 From: Jay.Hunnicutt at med.navy.mil (Hunnicutt, Jay E. (Civ)) Date: Wed, 21 Oct 2009 11:28:58 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2422.7060204@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: John, Just add the comma into the accepted characters like patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces and the spaces are left in the return as they are not a part of the condition. Query: select dbo.F_DropSpecChar('abc fge, 123, NC') Returns: abc fge, 123, NC Jay Hunnicutt -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, October 21, 2009 11:09 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character I am working on that. In fact I have already created a stored procedure - I don't THINK about functions. I have it working as a SP though. I do have to leave characters like ,. and space for my purposes. This will be cleaning up name and address fields. I have tested it though and it did replace the special character that was giving me fits, but it also replaced necessary spaces. How do I add the space character, period and comma to the pattern? John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > If you make it a SQL Scalar function you can use it to strip > characters for select, Update and insert statements as needed. Makes > it a little easier to use as well as reusable. > > > CREATE FUNCTION F_DropSpecChar > ( > -- Add the parameters for the function here > @S varchar(100) > > ) > RETURNS varchar(100) > AS > BEGIN > -- Declare the return variable here > DECLARE @Result varchar(100) > DECLARE @i INTEGER > > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > while @i > 0 > begin > select @s = replace(@s, substring(@s, @i, 1), '') > select @i = patindex('%[^a-zA-Z0-9 ]%', @s) > end > > > SELECT @Result = @S > > -- Return the result of the function > RETURN @Result > > END > GO > > Query: > select dbo.F_DropSpecChar('qh*(*^&$^1234') > > Returns: > qh1234 > > > > > Jay Hunnicutt > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, October 21, 2009 9:56 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] SPAM-LOW: Re: C# replace a special character > > Mark, > > This performs an update on an existing column in an existing table > simply by specifying the tablename / column name? > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I >> wanted to exclude all except alphas, I know that it is not C#, and I >> know you may prefer C# as practice, so if it is no useful, just bin > it. >> I got the code from this site, if you have a look, there is a little >> more there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> > PATINDEX('%[^a-zA-Z0-9]%', >> columnname), > 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark >> >> >> 2009/10/20 Charlotte Foust >> >>> Except the for the semicolon, that's the way to do it in VB.Net too. >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav >>> Brock >>> Sent: Tuesday, October 20, 2009 9:22 AM >>> To: dba-vb at databaseadvisors.com >>> Subject: Re: [dba-VB] C# replace a special character >>> >>> Hi John >>> >>> You should be able to use the Replace method directly on your string >>> holding the line or the file: >>> >>> theStringToCleanUp.Replace(((char)26).ToString(),""); >>> >>> like: >>> >>> string contents = File.ReadAllText(path); File.WriteAllText(path, >>> contents.Replace(((char)26).ToString(),"")); >>> >>> /gustav >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Oct 21 10:46:47 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:46:47 -0400 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> Message-ID: <4ADF2CE7.4050902@colbyconsulting.com> Jay, Thanks for that. I figured it out, added the special characters that I need and tested it and it is working great. And pretty darned fast IMHO. I did a replace on one field, 62.8 million records, 2:52 (three minutes). Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores assigned to SQL Server. John W. Colby www.ColbyConsulting.com Hunnicutt, Jay E. (Civ) wrote: > John, > Just add the comma into the accepted characters like > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > and the spaces are left in the return as they are not a part of the > condition. > > Query: > select dbo.F_DropSpecChar('abc fge, 123, NC') > > Returns: > > abc fge, 123, NC > > Jay Hunnicutt From jwcolby at colbyconsulting.com Wed Oct 21 10:47:13 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 21 Oct 2009 11:47:13 -0400 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF277F.60802@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> Message-ID: <4ADF2D01.9000308@colbyconsulting.com> Just an FYI, I ran this against 1 million records, in a query that pulled the top(1000000) City fields (where this specific problem lies) and it took about 13 seconds. This is with an index in place that includes the city field. I then ran it against the entire table (62.8 million records) and it took 2 minutes 52 seconds. This will become a standard part of my program for cleaning up my data. Thanks Mark Breen! John W. Colby www.ColbyConsulting.com jwcolby wrote: > Mark, > > Below is the SP I created to perform this magic. I will be running this on 66 million records so we > shall see about performance. > > set ANSI_NULLS ON > set QUOTED_IDENTIFIER ON > go > > -- ============================================= > -- Author: > -- Create date: > -- Description: > -- > --WHILE @@rowcount > 0 > -- UPDATE tablename > -- SET columnname = REPLACE(columnname, > -- SUBSTRING(columnname, > -- PATINDEX('%[^a-zA-Z0-9]%', > -- columnname), 1), '') > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > -- > -- ============================================= > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > -- Add the parameters for the stored procedure here > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > AS > BEGIN > -- SET NOCOUNT ON added to prevent extra result sets from > -- interfering with SELECT statements. > SET NOCOUNT ON; > declare @SQL varchar(1000) > declare @PatIndex varchar(50) > > BEGIN TRY > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > SELECT @SQL = 'WHILE @@rowcount > 0 > UPDATE ' + @DBName + '.dbo.' + @TblName + ' > SET ' + @FldName + ' = REPLACE(' + @FldName + ', > SUBSTRING(' + @FldName + ', > PATINDEX(''' + @PatIndex + ''', > ' + @FldName + '), 1), '''') > WHERE PATINDEX(''' + @PatIndex + ''', ' + @FldName + ') <> 0' > exec (@SQL) > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > END TRY > BEGIN CATCH > print 'There was an error REPLACING CHARACTERS IN ' + @DBName + '.' + @TblName + '.' + @FldName > print @SQL > print ERROR_MESSAGE() > END CATCH > END > > > John W. Colby > www.ColbyConsulting.com > > > Mark Breen wrote: >> Hello John, >> I used the following SQL today, and it works a treat, in my case, I wanted >> to exclude all except alphas, I know that it is not C#, and I know you may >> prefer C# as practice, so if it is no useful, just bin it. >> >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> >> >> WHILE @@rowcount > 0 >> UPDATE tablename >> SET columnname = REPLACE(columnname, >> SUBSTRING(columnname, >> PATINDEX('%[^a-zA-Z0-9]%', >> columnname), 1), '') >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 >> >> >> >> >> Mark > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:27:36 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:27:36 +0100 Subject: [dba-VB] SPAM-LOW: Re: C# replace a special character In-Reply-To: <4ADF2CE7.4050902@colbyconsulting.com> References: <4ADF1305.1090809@colbyconsulting.com> <4ADF2422.7060204@colbyconsulting.com> <4ADF2CE7.4050902@colbyconsulting.com> Message-ID: Hello John, As they say, when you only have a hammer, everything looks like a nail. My hammer is my SQL Skills, and I know that I sometimes use them where C# would be more appropriate, I see from Shamils code how easy it is in .Net also, anyway, we all have the options now of c#, PB and TSQL. Glad it worked, thanks Mark 2009/10/21 jwcolby > Jay, > > Thanks for that. I figured it out, added the special characters that I > need and tested it and it is > working great. And pretty darned fast IMHO. I did a replace on one field, > 62.8 million records, > 2:52 (three minutes). > > Machine specs: AMD 3GHz quad core, 16g RAM, Windows 2003 x64. Three cores > assigned to SQL Server. > > John W. Colby > www.ColbyConsulting.com > > > Hunnicutt, Jay E. (Civ) wrote: > > John, > > Just add the comma into the accepted characters like > > patindex('%[^a-zA-Z0-9, ]%', @s). Also I tested on a string with spaces > > and the spaces are left in the return as they are not a part of the > > condition. > > > > Query: > > select dbo.F_DropSpecChar('abc fge, 123, NC') > > > > Returns: > > > > abc fge, 123, NC > > > > Jay Hunnicutt > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:29:54 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:29:54 +0100 Subject: [dba-VB] SP to replace characters In-Reply-To: <4ADF2D01.9000308@colbyconsulting.com> References: <4ADF277F.60802@colbyconsulting.com> <4ADF2D01.9000308@colbyconsulting.com> Message-ID: Hello John, thanks for the credit, but the real credit goes to Nigel Rivett. But thanks anyway Have a nice weekend, Mark Mark Breen said >> I got the code from this site, if you have a look, there is a little more >> there that you may be able to make use of. >> >> Thanks to Nigel Rivett. >> >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html >> >> 2009/10/21 jwcolby > Just an FYI, I ran this against 1 million records, in a query that pulled > the top(1000000) City > fields (where this specific problem lies) and it took about 13 seconds. > This is with an index in > place that includes the city field. I then ran it against the entire table > (62.8 million records) > and it took 2 minutes 52 seconds. > > This will become a standard part of my program for cleaning up my data. > > Thanks Mark Breen! > > John W. Colby > www.ColbyConsulting.com > > > jwcolby wrote: > > Mark, > > > > Below is the SP I created to perform this magic. I will be running this > on 66 million records so we > > shall see about performance. > > > > set ANSI_NULLS ON > > set QUOTED_IDENTIFIER ON > > go > > > > -- ============================================= > > -- Author: > > -- Create date: > > -- Description: > > -- > > --WHILE @@rowcount > 0 > > -- UPDATE tablename > > -- SET columnname = REPLACE(columnname, > > -- SUBSTRING(columnname, > > -- > PATINDEX('%[^a-zA-Z0-9]%', > > -- columnname), 1), > '') > > -- WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > > -- > > -- ============================================= > > ALTER PROCEDURE [dbo].[sp_ReplaceCharacters] > > -- Add the parameters for the stored procedure here > > @DBName varchar(50), @TblName varchar(50), @FldName varchar(50) > > AS > > BEGIN > > -- SET NOCOUNT ON added to prevent extra result sets from > > -- interfering with SELECT statements. > > SET NOCOUNT ON; > > declare @SQL varchar(1000) > > declare @PatIndex varchar(50) > > > > BEGIN TRY > > set @PatIndex = '%[^a-zA-Z0-9 .,#]%' > > SELECT @SQL = 'WHILE @@rowcount > 0 > > UPDATE ' + @DBName + > '.dbo.' + @TblName + ' > > SET ' + @FldName + ' = > REPLACE(' + @FldName + ', > > SUBSTRING(' + @FldName + ', > > PATINDEX(''' + @PatIndex + > ''', > > ' + @FldName + > '), 1), '''') > > WHERE PATINDEX(''' + > @PatIndex + ''', ' + @FldName + ') <> 0' > > exec (@SQL) > > print 'success REPLACING CHARACTERS IN ' + @DBName + '.' + > @TblName + '.' + @FldName > > END TRY > > BEGIN CATCH > > print 'There was an error REPLACING CHARACTERS IN ' + > @DBName + '.' + @TblName + '.' + @FldName > > print @SQL > > print ERROR_MESSAGE() > > END CATCH > > END > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Mark Breen wrote: > >> Hello John, > >> I used the following SQL today, and it works a treat, in my case, I > wanted > >> to exclude all except alphas, I know that it is not C#, and I know you > may > >> prefer C# as practice, so if it is no useful, just bin it. > >> > >> I got the code from this site, if you have a look, there is a little > more > >> there that you may be able to make use of. > >> > >> Thanks to Nigel Rivett. > >> > >> http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html > >> > >> > >> > >> WHILE @@rowcount > 0 > >> UPDATE tablename > >> SET columnname = REPLACE(columnname, > >> SUBSTRING(columnname, > >> PATINDEX('%[^a-zA-Z0-9]%', > >> columnname), 1), > '') > >> WHERE PATINDEX('%[^a-zA-Z0-9]%', columnname) <> 0 > >> > >> > >> > >> > >> Mark > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 09:31:16 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 15:31:16 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <651EFB8166464CA1B4FD749BA94AD6CF@AMDXP> <4ADE1532.2000109@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> Message-ID: Hello Stuart, Have not heard of PowerBasic since 2001, is is still in use? or is this an old language that you still use through familiarity? Thanks Mark 2009/10/20 Stuart McLachlan > 200 megabytes tirivial. > > I just knocked this up in PowerBasic (this is the complete program!): > > #COMPILE EXE > #DIM ALL > FUNCTION PBMAIN () AS LONG > LOCAL strFile AS STRING > LOCAL lngSTart AS LONG > LOCAL strData AS STRING > strFile = "ML_Data.mdb" > lngStart = TIMER > OPEN strFile FOR BINARY AS #1 > GET$ #1, LOF(1), strData > CLOSE #1 > REPLACE "A" WITH "B" IN strData > OPEN strfile & "fixed" FOR BINARY as#1 > PUT$ #1, strData > CLOSE #1 > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > END FUNCTION > > It compiles to an 11KB executable with no dependencies. > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > that time was > taken in reading and writing the file to/from memory. > > > -- > Stuart > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > It is my guess that Regex will be too slow. This will be a file with > about 100 characters average > > per line, 2 million lines. Doing this in one big read MIGHT be possible > (and I will try) but > > reading in 200 million bytes all at once could cause issues. > > > > John W. Colby > > www.ColbyConsulting.com > > > > > > Jack and Pat wrote: > > > John, > > > > > > I did a google search to find this link. I'm not a C# person, but > thought > > > I'd pass this on > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > To: VBA > > > Subject: [dba-VB] C# replace a special character > > > > > > I have a file which contains a sprinkling of a special character - > decimal > > > 26, hex 1A (the SUB > > > character). This special character in the CSV file output to Accuzip > causes > > > Accuzip to hiccup. In > > > order to get on with my life I need to pre-process the files to get rid > of > > > this special character. > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > readline / replace / > > > writeline kind of thing. I think I need to use the > stringbuilder.replace > > > but I do not know how to > > > specify replacing this hex 1A with something else. The something else > would > > > ideally be nothing > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > Can anyone help me with this replace part of the problem. C# syntax > please. > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Thu Oct 22 12:53:30 2009 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 22 Oct 2009 18:53:30 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Message-ID: Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark From accessd at shaw.ca Thu Oct 22 13:53:31 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 11:53:31 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Hi Mark: If you are setting up MySQL you should start thinking of using SPs. MySQL version 5 has this feature and pass-through queries in MSAccess, especially SELECT type queries are soooo slowwwwww. Check out the following: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Thursday, October 22, 2009 10:54 AM To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From max.wanadoo at gmail.com Thu Oct 22 15:00:10 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 22 Oct 2009 21:00:10 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: Message-ID: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Mark, My friend gave me this answer - hope it helps I use the dreamweaver developer toolkit QUB it works exactly like access query's but it's web based and you need both dreamweaver and the developer toolkit to upload the files logon to the mysql then run a query. I've never found one better Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 22 October 2009 18:54 To: Discussion of Hardware and Software issues; Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello All, I have to assist a friend tomorrow in connecting to a mySQL database and starting to build some queries. I intend to show him the differences between writing queries in MS Access when linked to mySQL, and using pass-through queries within Access. I will also be explaining the benefits of having a few views created also. What I am looking for is a Windows based GUI tool that would connect to mySQL and allow him to build queries with click and drag like SSMS or Access does. This evening I have downloaded and installed two tools, one is the default GUI as shipped by mySQL and another is named EnginSite. Both seem, on initial looking anyway, to to allow me to drag a few fields from a table, but they do not seems to allow me to drag two or three tables and for the joins to be done in the GUI. Would anyone have any suggestions? TIA for your time, Mark _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 15:57:31 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 06:57:31 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg>, Message-ID: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From accessd at shaw.ca Thu Oct 22 18:57:38 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 22 Oct 2009 16:57:38 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com> <4ADE2B87.10366.D0827DE@stuart.lexacorp.com.pg> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> Message-ID: What sort of speed does PB get? Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, October 22, 2009 1:58 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character PB is still very much in use and undergoing continuous development. Latest version is 9.02 Combined it with SQL Tools for ODBC connectivity and it rocks. To quote from http://www.powerbasic.com PowerBASIC 9 for Windows, our GUI compiler, creates applications and DLLs with the Windows look and feel. And PowerBASIC Forms, our Visual Dialog Designer, will have those GUI apps running in no time at all! For text mode, there's the PowerBASIC Console Compiler 5 -- no fluff, no animated puppets, just intense computing power. That's why it's said "We put the POWER in BASIC!". These new versions sport a number of exciting new features. Both compilers can create client COM applications using Dispatch, Direct, Automation, or Dual interfaces. PowerBASIC 9 For Windows can create COM components (servers) using Dispatch, Direct, Automation, or Dual interfaces. The inline assembler has been expanded to support the full range of SIMD opcodes. A complete graphics engine, a printer package for Windows GDI host printers, dynamic pointers, and thread local storage, to name just a few. Dynamic Dialog Tools has been expanded to support TreeViews, ListViews, ProgressBars, ToolBars, ImageLists, Tab controls, and much, much more. The built in graphics engine has been expanded to support keyboard and mouse input with easy to use statements. The built in GDI printer engine has been expanded. Select the paper tray, set the paper size, turn duplexing on and off, enable or disable collating, and more. Signed and unsigned bit variables, 1 to 31 bits wide, can be packed one after another in User-Types and Unions. We have FIELD string variables, and a FIELD statement for resizable data structures. Even THREADED variables for Thread Local Storage (data local to a thread). -- Stuart On 22 Oct 2009 at 15:31, Mark Breen wrote: > Hello Stuart, > Have not heard of PowerBasic since 2001, is is still in use? or is this an > old language that you still use through familiarity? > > Thanks > > Mark > > > 2009/10/20 Stuart McLachlan > > > 200 megabytes tirivial. > > > > I just knocked this up in PowerBasic (this is the complete program!): > > > > #COMPILE EXE > > #DIM ALL > > FUNCTION PBMAIN () AS LONG > > LOCAL strFile AS STRING > > LOCAL lngSTart AS LONG > > LOCAL strData AS STRING > > strFile = "ML_Data.mdb" > > lngStart = TIMER > > OPEN strFile FOR BINARY AS #1 > > GET$ #1, LOF(1), strData > > CLOSE #1 > > REPLACE "A" WITH "B" IN strData > > OPEN strfile & "fixed" FOR BINARY as#1 > > PUT$ #1, strData > > CLOSE #1 > > MSGBOX "It took " & STR$(TIMER - lngstart) & " seconds" > > END FUNCTION > > > > It compiles to an 11KB executable with no dependencies. > > > > It took 18 seconds to process ML_Data.mdb which is 774MB in size. Most of > > that time was > > taken in reading and writing the file to/from memory. > > > > > > -- > > Stuart > > > > > > On 20 Oct 2009 at 15:53, jwcolby wrote: > > > > > It is my guess that Regex will be too slow. This will be a file with > > about 100 characters average > > > per line, 2 million lines. Doing this in one big read MIGHT be possible > > (and I will try) but > > > reading in 200 million bytes all at once could cause issues. > > > > > > John W. Colby > > > www.ColbyConsulting.com > > > > > > > > > Jack and Pat wrote: > > > > John, > > > > > > > > I did a google search to find this link. I'm not a C# person, but > > thought > > > > I'd pass this on > > > > > > > > http://dotnetperls.com/regex-replace-1 > > > > > > > > -----Original Message----- > > > > From: dba-vb-bounces at databaseadvisors.com > > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > > Sent: Tuesday, October 20, 2009 11:45 AM > > > > To: VBA > > > > Subject: [dba-VB] C# replace a special character > > > > > > > > I have a file which contains a sprinkling of a special character - > > decimal > > > > 26, hex 1A (the SUB > > > > character). This special character in the CSV file output to Accuzip > > causes > > > > Accuzip to hiccup. In > > > > order to get on with my life I need to pre-process the files to get rid > > of > > > > this special character. > > > > Because of the size of these files (hundreds of mbytes) I need to do a > > > > readline / replace / > > > > writeline kind of thing. I think I need to use the > > stringbuilder.replace > > > > but I do not know how to > > > > specify replacing this hex 1A with something else. The something else > > would > > > > ideally be nothing > > > > (empty string) but can be any valid alpha character (A, B etc). > > > > > > > > Can anyone help me with this replace part of the problem. C# syntax > > please. > > > > > > > _______________________________________________ > > > dba-VB mailing list > > > dba-VB at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Oct 22 22:29:27 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 23 Oct 2009 13:29:27 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, Message-ID: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > From max.wanadoo at gmail.com Fri Oct 23 01:58:47 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 07:58:47 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> Message-ID: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> But what can you do with it? I cannot think of anything that I would want to do outside of Access...is that sad or what? Fast is good, but fast doing nothing is nothing. I can do nothing instantaneously! Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 04:29 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] C# replace a special character Fast! Unlike .Net, it compiles to true native code, http://www.powerbasic.com/products/pbdll32/default.asp PowerBASIC for Windows is a native code compiler for 32-bit and 64-bit versions of Windows. It creates applications with a Graphical User Interface (GUI), to provide the typical "Look and Feel" of Windows. It creates highly efficient executables and industry- standard DLLs for optimum flexibility. The machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others. On 22 Oct 2009 at 16:57, Jim Lawrence wrote: > What sort of speed does PB get? > > Jim > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Fri Oct 23 05:48:50 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:48:50 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From marklbreen at gmail.com Fri Oct 23 05:54:52 2009 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 23 Oct 2009 11:54:52 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 08:12:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 14:12:33 +0100 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <4ae0ba5f.1701d00a.2bcf.2136@mx.google.com> Message-ID: <4ae1abd3.09c5660a.471e.ffff8b17@mx.google.com> Yes he would have to have dreamweaver installed Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 23 October 2009 11:49 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Max, thanks for that, If I understand what you have said correctly, he would have to install dreamweaver - did I get that right ? I am currently considering installing an ODBC and allowing him to build queries through linked tables in MS Access, then once he has built the table, I will show him how to copy the SQL and drop it into a pass-through query. For queries that he uses more than once, I will show him how to either create an sproc or a view depending on whether there are criteria to be supplied. Anyone any thoughts on that? On a further note for anyone else reading this thread, on further review (an additional five minutes), I noticed that EnginSite does have a diagram model for building multi-table queries, so that would be an option for someone that does not have Access, however, in my case, I think Access will be good enough. Thanks to all for your responses. Mark 2009/10/22 Max Wanadoo > Mark, > > My friend gave me this answer - hope it helps > > > I use the dreamweaver developer toolkit QUB it works exactly like access > query's but it's web based and you need both dreamweaver and the developer > toolkit to upload the files logon to the mysql then run a query. I've > never found one better > > > > > > Max > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: 22 October 2009 18:54 > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 09:01:54 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 10:01:54 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> Message-ID: <4AE1B752.7030306@colbyconsulting.com> > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max From max.wanadoo at gmail.com Fri Oct 23 09:05:33 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 15:05:33 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Yes, but I do all SQL stuff FROM access. I don't have the performance issues that you do (and I understand where you are at). So, what does PB do that I need to leave Access for? I can do ANYTHING from within Access (speed issues aside) Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 23 October 2009 15:02 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dwaters at usinternet.com Fri Oct 23 10:01:33 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 23 Oct 2009 10:01:33 -0500 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:02 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 10:24:22 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 19:24:22 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE1B752.7030306@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Hi John, I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 6:02 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character > I cannot think of anything that I would want to do outside of Access...is that sad or what? That is sad indeed. Nice that you have so much Access work that you never need to consider anything else though. I have a ton of SQL Server work for one specific client. While I can and do use Access to perform this work it is not very efficient. My biggest issue is simply that Access is single threaded so when I start a long running stored procedure out on the server, Access comes to a screeching halt. I have logging processes running in the code that executes these stored procedures. So I time how long, what the SP name is, what specific file is being created or loaded, date / time that the step occurred etc. When a SP starts to run, Access locks up. I cannot see the status log (through the Access FE) that tells me where I am in the process. As you can see, while Access does function, for this kind of thing it functions poorly. Personally, for a variety of reasons I am moving to C#.Net for this kind of development. C# is now widely accepted as a valid language by my clients, it is extremely powerful, and it is pretty darned fast, though it will not be as fast as a native EXE. C# has a ton of database stuff available to it (though I am not there yet), it has multi-threading (though I am not there yet), and on a Windows environment it can do pretty much anything I can imagine doing (and I have a very active imagination). Additionally it can be used from right inside of SQL Server (though I am not there yet). For me, C# makes a lot of sense. It has a steep learning curve though. If it weren't for the fact that I am a consultant first and foremost, I would go with VB.Net. I "played" with VB.Net quite a bit in the past and it was a bit easier to come up to speed on, and every bit as powerful as C# within the domain of problems I would ever attempt. However if I ever need to sell my .Net skills, C# is just an easier sell. John W. Colby www.ColbyConsulting.com Max Wanadoo wrote: > But what can you do with it? > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > Fast is good, but fast doing nothing is nothing. > > I can do nothing instantaneously! > > Max __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From Gustav at cactus.dk Fri Oct 23 11:02:26 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 18:02:26 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From jwcolby at colbyconsulting.com Fri Oct 23 11:25:01 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 12:25:01 -0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> Message-ID: <4AE1D8DD.6090103@colbyconsulting.com> Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil From cfoust at infostatsystems.com Fri Oct 23 11:36:18 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 09:36:18 -0700 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan From jwcolby at colbyconsulting.com Fri Oct 23 12:00:18 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 13:00:18 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1E122.1020902@colbyconsulting.com> > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The two > languages will get the missing features from the other and it will then > be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur > with VS 2010 or later. But after the change, using C# or VB.Net will be > just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From max.wanadoo at gmail.com Fri Oct 23 12:02:12 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 23 Oct 2009 18:02:12 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> Message-ID: <4ae1e1ad.170e660a.2cdd.4c8c@mx.google.com> Presumably then, a programmer could use "exactly" the same functionality to achieve "exactly" the same result but could use the language of their choice. Ie. "Good morning", "Guten Morgen" sounds the same to the person who "understands" the output? Ie, BuiltInFunction xyz() has same out put regardless of what constructs/coding was used within the function as long as writing it in BOTH languages achieved the same output. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 23 October 2009 17:36 To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character It will be in the next version of Visual Studio, which is 2010. The two languages will get the missing features from the other and it will then be a matter of preference which you use. I'll stick with VB.Net, thanks. I don't have the time or interest in switching to C#. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 8:02 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: <000901ca5407$0963f350$1c2bd9f0$@spb.ru> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Fri Oct 23 12:34:09 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 23 Oct 2009 21:34:09 +0400 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <000d01ca5407$0ad75970$20860c50$@spb.ru> Hi John, Thank you for your extended comment on "C# vs. native EXE." --Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 8:25 PM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru __________ Information from ESET NOD32 Antivirus, version of virus signature database 4536 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From cfoust at infostatsystems.com Fri Oct 23 12:51:43 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 10:51:43 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1E122.1020902@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: But I'm not looker for higher pay and higher mystique. I'm 65 and I don't want to program forever or be a consultant at all. VB.Net definitely can do some things C# can't, another reason I never saw much point in learning C# after I made the transition to .Net. We were mandated to use VB.Net because it would make the transition from Access faster. Fine by me. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 10:00 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] c# as a language of choice > It will be in the next version of Visual Studio, which is 2010. I thought I had read that it will actually take awhile to truly merge the two. >I don't have the time or interest in switching to C#. And there is no reason to, even today. VB.Net has 99% of the capabilities of C# today. Perhaps less well known, VB.Net actually has a few capabilities that C# doesn't. In the end, for 99.9% of developers, either language is a fine choice, even today. My point is simply that C# CURRENTLY has better pay and higher mystique (which translates to higher pay). I am not an hourly employee nor do I ever anticipate being one again. As a consultant C# "sells better", or so I am told. And finally, I already know VB syntax. Framework syntax is almost identical AFAICT, it is the LANGUAGE syntax that differs. By learning C# I have a leg up should I ever need it. JMO of course. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > It will be in the next version of Visual Studio, which is 2010. The > two languages will get the missing features from the other and it will > then be a matter of preference which you use. I'll stick with VB.Net, > thanks. I don't have the time or interest in switching to C#. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters > Sent: Friday, October 23, 2009 8:02 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] C# replace a special character > > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will > be 'equalizing' C# and VB.Net. I don't remember if that's going to > occur with VS 2010 or later. But after the change, using C# or VB.Net > will be just a syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Oct 23 13:00:40 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 Oct 2009 20:00:40 +0200 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Message-ID: Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav From accessd at shaw.ca Fri Oct 23 13:09:58 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:09:58 -0700 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hi Mark: If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped using ODBC, except in extreme circumstances over 10 years ago and have never looked back. Back in 1997, a client did month end reports through MS Access to a MS SQL BE DB via a pass-through implementation. The report was done in two separate sections with each section taking 50 minutes before the report would start. They would do one report in the morning and one in the afternoon. The query was a 'Select * ..." type. When I converted their month-end report to ADO-OLE and used a SP. The results were that the entire report started in less than 2 seconds. See the sample code at: http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp HTH Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, October 23, 2009 3:55 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL Hello Jim, thanks for that, yes, I will train him on the benefits of utilising the Client - Server aspect of the db, Just curious though, if I want to return all rows from the web based hosting centre, and I have to choices of a) Select * from Customers ran as a PST query or b) usp_GetAllCustomers ran as a PST query or c) Select * from Customers ran as a linked table in Access do you think that there would be any noticeable performance difference, my instinct would be that there would be none. Of course if there was a million orders and we wanted to sum all orders where customer id = 22124, that would have to be better as Pass Through, but I would assume minor differences between an sproc and simply including all the SQL within the PST query. We would loose the precomplile but from a data and query perspective, I would expect similar (1-2 seconds) performance. Thanks Mark 2009/10/22 Jim Lawrence > Hi Mark: > > If you are setting up MySQL you should start thinking of using SPs. MySQL > version 5 has this feature and pass-through queries in MSAccess, especially > SELECT type queries are soooo slowwwwww. > > Check out the following: > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > HTH > Jim > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Thursday, October 22, 2009 10:54 AM > To: Discussion of Hardware and Software issues; Discussion concerning > Visual > Basic and related programming issues. > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello All, > I have to assist a friend tomorrow in connecting to a mySQL database and > starting to build some queries. > > I intend to show him the differences between writing queries in MS Access > when linked to mySQL, and using pass-through queries within Access. > > I will also be explaining the benefits of having a few views created also. > > What I am looking for is a Windows based GUI tool that would connect to > mySQL and allow him to build queries with click and drag like SSMS or > Access > does. > > This evening I have downloaded and installed two tools, one is the default > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > initial looking anyway, to to allow me to drag a few fields from a table, > but they do not seems to allow me to drag two or three tables and for the > joins to be done in the GUI. > > Would anyone have any suggestions? > > TIA for your time, > > Mark > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:19:10 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:19:10 -0700 Subject: [dba-VB] C# as a language of choice In-Reply-To: <4AE1D8DD.6090103@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com> <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg> <4AE12317.17863.189F3553@stuart.lexacorp.com.pg> <4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> <001501ca53f4$e6e62ad0$b4b28070$@spb.ru> <4AE1D8DD.6090103@colbyconsulting.com> Message-ID: <711C50C13D994C65B774F500045A395D@creativesystemdesigns.com> The truth is that under .Net there is no performance advantage to using VB.Net or C#.Net or any other .Net flavour. Also, you can mix and match code extensions as long as they are not in the same module. The only advantage I can see is that C# sounds cooler... and we know real men and women only use 'C' or derivatives thereof. ;-) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 9:25 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] C# as a language of choice Shamil, > I'm just wondering what kind of "native EXE" applications you could have developed for your customers would be faster than equivalent C#/VB.NET ones and why? I wasn't commenting on "what could be done in one vs the other" I was simply commenting that a native EXE is probably going to be faster than .Net in most situations. That is almost indisputable. Whether the speed increase is noticeable depends entirely on the situation. In the end it doesn't matter to me. I am going with C# simply because it is a marketing tool - "I develop in C#". C# is a fine language, I don't LOSE much if anything by selecting it as my language of choice, in fact I GAIN the framework and all that implies. People are more accepting of things they are familiar with, whether that is the race of a person, the make of a car, or the language you mention in a sales presentation. C# has been marketed by Microsoft and the whole world has heard of it. I would really prefer VB.Net over C#.Net but at this point C# has the edge in perception. VB is still a "toy" to too many people in positions of power (just as Access is). The fact that it isn't true really doesn't matter. And so I am enrolled in a C# class at the local community college. Which is really kind of fun. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > I'm just wondering what kind of "native EXE" applications you could have > developed for your customers would be faster than equivalent C#/VB.NET ones > and why? > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From accessd at shaw.ca Fri Oct 23 13:22:52 2009 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 23 Oct 2009 11:22:52 -0700 Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) In-Reply-To: References: Message-ID: Ha ha ha... I guess the universal translator doesn't work... no wonder there are coding problems. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 11:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS2010: Dependency Injection (DI),The Microsoft Extensibility Framework (MEF) Hi Shamil Thanks. Exactly what I was looking for - love "naive examples"! I have nothing to use it for currently. But it could be one of those topics that if you know something about it, it will pop forward when it could be of value to your project. /gustav >>> shamil at smsconsulting.spb.ru 23-10-2009 19:34 >>> Hi Gustav -- I'd go for it at least for educational purposes. But using DI in business apps we develop could be often an overkill AFAIS now (I can be wrong) - using DI always(?) needs more time to develop and test - yes, it should pay back well in long run but how often do we have that "long run" coming into reality? Here is a link on foundation info: http://martinfowler.com/articles/injection.html Trying to be more "ground based" here these days :) Thank you. -- Shamil P.S. I suppose it would be a lot of fun to (re-)develop large business apps using DI and MEF - are there anybody who have funds for such a project? - ready to go with that here :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, October 23, 2009 8:02 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] VS2010: Dependency Injection (DI), The Microsoft Extensibility Framework (MEF) Hi all Dependency Injection (DI) is a technique that includes a set of well-known design patterns, and most existing DI Containers operate within the boundaries of these patterns. The Microsoft Extensibility Framework (MEF) - which is a part of .NET 4.0 - has many similarities with DI Containers, although there are differences. This session dives into the relationship between MEF and the existing DI patterns to better understand what MEF is - and is not. Could someone please indicate what this is about and/or provide a link to some tutorial on the subject? Should I attend this 2? hour session at my local user group? /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Oct 23 13:37:09 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:37:09 -0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <4AE1F7D5.9020405@colbyconsulting.com> > Not long ago you were just starting to use SQL Server! So much to know, so little time. John W. Colby www.ColbyConsulting.com Dan Waters wrote: > Hi John, > > Not long ago you were just starting to use SQL Server! > > I thought I would make a comment that MS has announced that they will be > 'equalizing' C# and VB.Net. I don't remember if that's going to occur with > VS 2010 or later. But after the change, using C# or VB.Net will be just a > syntax preference choice! > > I'm going to learn VB.Net because it's closest to what I already know. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, October 23, 2009 9:02 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] C# replace a special character > > > I cannot think of anything that I would want to do outside of Access...is > that sad or what? > > That is sad indeed. Nice that you have so much Access work that you never > need to consider anything > else though. > > I have a ton of SQL Server work for one specific client. While I can and do > use Access to perform > this work it is not very efficient. My biggest issue is simply that Access > is single threaded so > when I start a long running stored procedure out on the server, Access comes > to a screeching halt. > > I have logging processes running in the code that executes these stored > procedures. So I time how > long, what the SP name is, what specific file is being created or loaded, > date / time that the step > occurred etc. When a SP starts to run, Access locks up. I cannot see the > status log (through the > Access FE) that tells me where I am in the process. > > As you can see, while Access does function, for this kind of thing it > functions poorly. > > Personally, for a variety of reasons I am moving to C#.Net for this kind of > development. C# is now > widely accepted as a valid language by my clients, it is extremely powerful, > and it is pretty darned > fast, though it will not be as fast as a native EXE. C# has a ton of > database stuff available to it > (though I am not there yet), it has multi-threading (though I am not there > yet), and on a Windows > environment it can do pretty much anything I can imagine doing (and I have a > very active > imagination). Additionally it can be used from right inside of SQL Server > (though I am not there yet). > > For me, C# makes a lot of sense. It has a steep learning curve though. If > it weren't for the fact > that I am a consultant first and foremost, I would go with VB.Net. I > "played" with VB.Net quite a > bit in the past and it was a bit easier to come up to speed on, and every > bit as powerful as C# > within the domain of problems I would ever attempt. > > However if I ever need to sell my .Net skills, C# is just an easier sell. > > John W. Colby > www.ColbyConsulting.com > > > Max Wanadoo wrote: >> But what can you do with it? >> >> I cannot think of anything that I would want to do outside of Access...is >> that sad or what? >> >> Fast is good, but fast doing nothing is nothing. >> >> I can do nothing instantaneously! >> >> Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Oct 23 13:39:48 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 Oct 2009 14:39:48 -0400 Subject: [dba-VB] c# as a language of choice In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> Message-ID: <4AE1F874.1040805@colbyconsulting.com> >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw much > point in learning C# after I made the transition to .Net. We were > mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte From cfoust at infostatsystems.com Fri Oct 23 13:41:19 2009 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 23 Oct 2009 11:41:19 -0700 Subject: [dba-VB] c# as a language of choice In-Reply-To: <4AE1F874.1040805@colbyconsulting.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com><4AE1B752.7030306@colbyconsulting.com> <4AE1E122.1020902@colbyconsulting.com> <4AE1F874.1040805@colbyconsulting.com> Message-ID: Even with grown kids, I figure I'll be working the rest of my life too. Just not as a programmer, please. Charlotte -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, October 23, 2009 11:40 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] c# as a language of choice >I'm 65 and I don't want to program forever or be a consultant at all. I'm 55 and I have an 8 year old boy and a 6 year old girl. What I want pretty much doesn't come into play. ;) I figure to be working well into my 90s. 8~o John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > But I'm not looker for higher pay and higher mystique. I'm 65 and I > don't want to program forever or be a consultant at all. VB.Net > definitely can do some things C# can't, another reason I never saw > much point in learning C# after I made the transition to .Net. We > were mandated to use VB.Net because it would make the transition from Access > faster. Fine by me. > > Charlotte _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Oct 23 16:06:11 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 24 Oct 2009 07:06:11 +1000 Subject: [dba-VB] C# replace a special character In-Reply-To: <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> Message-ID: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > From max.wanadoo at gmail.com Fri Oct 23 22:44:51 2009 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Sat, 24 Oct 2009 04:44:51 +0100 Subject: [dba-VB] C# replace a special character In-Reply-To: <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE1B752.7030306@colbyconsulting.com>, <4ae1b83f.0e0f660a.587c.ffffb32d@mx.google.com> <4AE21AC3.18633.1C66AC0C@stuart.lexacorp.com.pg> Message-ID: <4ae27855.0a04d00a.69f3.ffffd6b8@mx.google.com> Thanks Stuart, I merely meant "from my perspective and from what I do". I am sure there are tons of stuff that other people need. I used to use QB some years back for "quick apps" and it was great. Max -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: 23 October 2009 22:06 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] C# replace a special character A "listener application" that sit on a machine on a network behind a firewall. It runs 24/7 and monitors a TCP Port which is "port forwarded" by the router to that machiine from anywhere on the internet. When a packet is received, the listener parses it, queries a database, formats the response and sends it back out to the originator. Can you build a TCP/IP server which will run 24/7 in Access? (and in 30KB) Take a look at the Tax Calculators on my website. Imagine distributing those to the public as Access applications!!! Lots of other examples if you want. -- Stuart On 23 Oct 2009 at 15:05, Max Wanadoo wrote: > Yes, but I do all SQL stuff FROM access. I don't have the performance issues > that you do (and I understand where you are at). > > So, what does PB do that I need to leave Access for? I can do ANYTHING from > within Access (speed issues aside) > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Oct 24 05:19:17 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 14:19:17 +0400 Subject: [dba-VB] C# replace a special character In-Reply-To: References: <4ADDDB10.4010703@colbyconsulting.com>, <4AE0C73B.29433.17386206@stuart.lexacorp.com.pg>, <4AE12317.17863.189F3553@stuart.lexacorp.com.pg><4ae15436.1c05d00a.1fba.ffffbb39@mx.google.com> <4AE1B752.7030306@colbyconsulting.com> Message-ID: <000601ca5493$728c8d60$57a5a820$@spb.ru> Hi Dan, Go for C# - VB.NET is usually just 5%(?) closer than C# to "what folks already know" when learning .NET development after VBA/VB6 - spending just a few more time now to adapt to C# syntax you'll gain considerable advantage in long run. But I suppose that using C# from the very beginning will not force to spend more time on learning curve - the opposite is true - why? - keep reading this comment... ...as William noted myriad of times here - there are a lot of C# ready to use samples - that's a very important fact for learning curve and for real life development - despite the fact that there are automatic convertors from C# to VB.NET and vice versa they are not 100% correct but even if they would have been 99% correct you would have been losing time converting C# -> VB.NET and therefore losing advantage in competition with C# developers, and this competition is becoming more and more strict every day... ...using C# you also keep saving time as you do not need to type Function, Sub, Dim, As etc. - in long run that would be a good saving of your life time to be better spent with friends and family than with computers... ...etc... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, October 23, 2009 7:02 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] C# replace a special character Hi John, Not long ago you were just starting to use SQL Server! I thought I would make a comment that MS has announced that they will be 'equalizing' C# and VB.Net. I don't remember if that's going to occur with VS 2010 or later. But after the change, using C# or VB.Net will be just a syntax preference choice! I'm going to learn VB.Net because it's closest to what I already know. Dan <<< snip >>> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4537 (20091023) __________ The message was checked by ESET NOD32 Antivirus. http://www.esetnod32.ru From shamil at smsconsulting.spb.ru Sat Oct 24 10:26:13 2009 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 24 Oct 2009 19:26:13 +0400 Subject: [dba-VB] How to script MS SQL 2005 Database Objects using .NET... Message-ID: <000001ca54be$55977870$00c66950$@spb.ru> Hi All, I'm wondering how to perform the subject task? - similar to MS SQL Management Studio: {{Database}} -> Right-Click -> Tasks -> Generate Scripts.. Etc. I guess is should be possible to write custom code to get SQL DLL scripts for a given set of tables, their relationships and triggers? Is there a ready to use object model for such coding? Or one have to use system (extended) SPs? Or..? I wanted to automate this task. And I do not want to use third-party tools currently. Thank you. -- Shamil From marklbreen at gmail.com Mon Oct 26 02:24:14 2009 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 26 Oct 2009 07:24:14 +0000 Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL In-Reply-To: References: <37E84565FC1F4DD28269FBFD9E7B4958@creativesystemdesigns.com> Message-ID: Hello All, In the past I found it a PITA to use MS Access as a SQL generator for SQL Server because Access / ODBC drivers applied a prefix of the Scheme name for all the tables - dbo_Customers. This meant that I could not build a query and then copy and paste the SQL unless I first renamed the tables, either manually or with code. However, I can let you know that with the ODBC Driver and the mySQL db that I hooked up to, the tables came with just their names - Customers, so I had a successful session on Friday showing my friend how to build queries. He was delighted, one query that takes three seconds used to take them three days in the past. Interestingly, I did some tests on performace of Linked tables compared to pass-through. The biggest query we ran was a six or seven table query that we saved and then ran a cross tab against that. It ran in 2 - 3 seconds, with all tables linked and no pass through used at all. I have to say in that case, or in similar examples it is not worth while running it as pass-through. I know that in certain cases PST will be faster, but I could not demonstrate a practical example on Friday. I know the benefits, so I am not trying to persuade anyone here, but I am just noting that you may find it is not worth jumping through hoops for PST until you know you need it. Thanks to all, Mark 2009/10/23 Jim Lawrence > Hi Mark: > > If you can, it is better to use ADO-OLE than ODBC-Pass-Through. I stopped > using ODBC, except in extreme circumstances over 10 years ago and have > never > looked back. > > Back in 1997, a client did month end reports through MS Access to a MS SQL > BE DB via a pass-through implementation. The report was done in two > separate > sections with each section taking 50 minutes before the report would start. > They would do one report in the morning and one in the afternoon. The query > was a 'Select * ..." type. > > When I converted their month-end report to ADO-OLE and used a SP. The > results were that the entire report started in less than 2 seconds. See the > sample code at: > > > http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo > rts.asp > > HTH > Jim > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > Sent: Friday, October 23, 2009 3:55 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Can anyone suggest a Windows good client for mySQL > > Hello Jim, > thanks for that, yes, I will train him on the benefits of utilising the > Client - Server aspect of the db, > > Just curious though, if I want to return all rows from the web based > hosting > centre, and I have to choices of > a) Select * from Customers ran as a PST query or > b) usp_GetAllCustomers ran as a PST query or > c) Select * from Customers ran as a linked table in Access > > do you think that there would be any noticeable performance difference, my > instinct would be that there would be none. > > Of course if there was a million orders and we wanted to sum all orders > where customer id = 22124, that would have to be better as Pass Through, > but > I would assume minor differences between an sproc and simply including all > the SQL within the PST query. We would loose the precomplile but from a > data and query perspective, I would expect similar (1-2 seconds) > performance. > > Thanks > > Mark > > > > > 2009/10/22 Jim Lawrence > > > Hi Mark: > > > > If you are setting up MySQL you should start thinking of using SPs. MySQL > > version 5 has this feature and pass-through queries in MSAccess, > especially > > SELECT type queries are soooo slowwwwww. > > > > Check out the following: > > > > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > > > > HTH > > Jim > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen > > Sent: Thursday, October 22, 2009 10:54 AM > > To: Discussion of Hardware and Software issues; Discussion concerning > > Visual > > Basic and related programming issues. > > Subject: [dba-VB] Can anyone suggest a Windows good client for mySQL > > > > Hello All, > > I have to assist a friend tomorrow in connecting to a mySQL database and > > starting to build some queries. > > > > I intend to show him the differences between writing queries in MS Access > > when linked to mySQL, and using pass-through queries within Access. > > > > I will also be explaining the benefits of having a few views created > also. > > > > What I am looking for is a Windows based GUI tool that would connect to > > mySQL and allow him to build queries with click and drag like SSMS or > > Access > > does. > > > > This evening I have downloaded and installed two tools, one is the > default > > GUI as shipped by mySQL and another is named EnginSite. Both seem, on > > initial looking anyway, to to allow me to drag a few fields from a table, > > but they do not seems to allow me to drag two or three tables and for the > > joins to be done in the GUI. > > > > Would anyone have any suggestions? > > > > TIA for your time, > > > > Mark > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Oct 26 07:51:17 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 08:51:17 -0400 Subject: [dba-VB] C# - How to access objects in inherited list Message-ID: <4AE59B45.7030003@colbyconsulting.com> Just to learn how, I am trying to subclass a generic list class. My grade calculator previously dimensioned a list and used it. The syntax to access objects in the list in that case was MyList{MyIndex]. In my class definition I subclassed my Grades to inherit the list class. class clsGrades: List { } Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the name of the list property that [] references? TIA -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Oct 26 08:13:24 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 26 Oct 2009 09:13:24 -0400 Subject: [dba-VB] C# - How to access objects in inherited list In-Reply-To: <4AE59B45.7030003@colbyconsulting.com> References: <4AE59B45.7030003@colbyconsulting.com> Message-ID: <4AE5A074.50900@colbyconsulting.com> Well, I don't have a clue what I was doing before but this[] does work. My guess is that I was using This[] (capital T) instead of this[]. Anyway, I got it working. Sorry for the ring. John W. Colby www.ColbyConsulting.com jwcolby wrote: > Just to learn how, I am trying to subclass a generic list class. > > My grade calculator previously dimensioned a list and used it. The syntax to access objects in the > list in that case was MyList{MyIndex]. > > In my class definition I subclassed my Grades to inherit the list class. > > class clsGrades: List > { > } > > Now I need to replace all of the code that previouly referenced MyList[]. However I cannot for the > life of me figure out the syntax. This[] does not work. [] by itself does not work. What is the > name of the list property that [] references? > > TIA > From dwaters at usinternet.com Mon Oct 26 12:03:22 2009 From: dwaters at usinternet.com (Dan Waters) Date: Mon, 26 Oct 2009 12:03:22 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? Message-ID: Hello! I have some code from a forum that I believe may allow dragging a file to an Access for so that the file's full path can be captured by the form. If this can be done, then a file can be very easily 'attached' to an Access database. The code comes from here: http://bytes.com/topic/access/answers/197392-drag-drop The code was originally written by Felix Lima (MS Support Engineer), and posted by Stephen Lebans. I first tried putting this code into an mdb, but the database froze because the code that was waiting for a Windows Message ran continuously. So, I want to ask if someone can take this code and put it into a DLL file like Felix says it should be. I've put it all into a small Access file that I can send to you. If this works, I'll post a 'how to' in DB Advisors. Thanks! Dan From davidmcafee at gmail.com Mon Oct 26 12:11:52 2009 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 26 Oct 2009 10:11:52 -0700 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: Message-ID: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From DWUTKA at Marlow.com Tue Oct 27 12:05:18 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 27 Oct 2009 12:05:18 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Monday, October 26, 2009 12:12 PM To: dwaters at usinternet.com; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Sounds like a project for Drew :) Does the database freeze immediately or after a while of using it? D On Mon, Oct 26, 2009 at 10:03 AM, Dan Waters wrote: > Hello! > > I have some code from a forum that I believe may allow dragging a file to an > Access for so that the file's full path can be captured by the form. ?If > this can be done, then a file can be very easily 'attached' to an Access > database. > > The code comes from here: > http://bytes.com/topic/access/answers/197392-drag-drop > > The code was originally written by Felix Lima (MS Support Engineer), and > posted by Stephen Lebans. > > I first tried putting this code into an mdb, but the database froze because > the code that was waiting for a Windows Message ran continuously. > > So, I want to ask if someone can take this code and put it into a DLL file > like Felix says it should be. ?I've put it all into a small Access file that > I can send to you. ?If this works, I'll post a 'how to' in DB Advisors. > > Thanks! > Dan > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 dwaters at usinternet.com Tue Oct 27 18:53:27 2009 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 27 Oct 2009 18:53:27 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew From michael at ddisolutions.com.au Tue Oct 27 19:03:17 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 28 Oct 2009 11:03:17 +1100 Subject: [dba-VB] Create a DLL for Access Drag Drop? References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015825AE@ddi-01.DDI.local> Hi Dan, In the dim dark past I think I did something like this. IIRC you supply the Data object (can be anything) in the StartDrag(?) event. I could be wrong... Cheers Michael Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, October 27, 2009 12:05 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Have a lot to do right now, but really the best way to deal with drag and drop WITHOUT API's is to just use the treeview control, it has it's own drag and drop capabilities (you can drag a file from a windows explorer window into a treeview control, and use plain old VBA to deal with the incoming file path). Also, as to the 'freezing' issue, this is due to the quirk of the Access 2000 (and later) issue with callback functions. Callback functions in Access 2000 (and later) will work just fine, until you go into the VBE window. Then Access will go bonkers. Drew _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Oct 28 15:29:26 2009 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 28 Oct 2009 15:29:26 -0500 Subject: [dba-VB] Create a DLL for Access Drag Drop? In-Reply-To: References: <8786a4c00910261011u77c34a6ewe800cf7d4df4806a@mail.gmail.com> Message-ID: Close your database, and reopen it. DO NOT go into any VBA code AT ALL. See if your procedure works. It probably should (though I haven't actually tried your code). The problem is that when ANY callback function runs, if the VBE has been opened, it will freak Access out like crazy! As for code to use a treeview: Option Compare Database Dim tvw As TreeView Private Sub Form_Load() Set tvw = Me.TreeView0.Object End Sub Private Sub Form_Unload(Cancel As Integer) Set tvw = Nothing End Sub Private Sub TreeView0_OLEDragDrop(Data As Object, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim nd As Node Select Case DetermineDropType(Data) Case "TEXT" Case "FILES" Case Else MsgBox "Invalid Object Type" End Select End Sub Function DetermineDropType(Data As Object) As String On Error Resume Next Dim strTemp As String strTemp = Data.GetData(1) If Not Err Then DetermineDropType = "TEXT" Exit Function End If Err.Clear If Data.Files.Count > 0 Then DetermineDropType = "FILES" End If End Function In the case 'FILES' you would use something like: For i=1 to Data.Files.Count strPath=DataFiles(i) 'do something with strpath Next i Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Tuesday, October 27, 2009 6:53 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Create a DLL for Access Drag Drop? Hi Drew, I'm using Access 2003, and once the code starts running in the 'callback procedure', Access does go bonkers. I'm guessing that placing this procedure into a DLL will solve that. I found Q209898, which discusses dragging and dropping nodes in a treeview control. I also set up a form and was able to trigger the OLEDragOver event and the OLEDragDrop event when I dragged a file across the control. In both there is a Data object argument, which I don't know how to use to get a file's full path. Have you been able to get a file's path using a treeview? What events/code did you use? Thanks! Dan The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.