From Gustav at cactus.dk Thu May 1 01:28:56 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 08:28:56 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi all This should be doable as Novell claims Mono to be 100% compatible with ASP.NET. A two-page how-to guide is published here: http://novellevents.novell.com/t/5096990/63304383/9281/0/ The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav From wdhindman at dejpolsystems.com Thu May 1 02:24:15 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 1 May 2008 03:24:15 -0400 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux References: Message-ID: ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From pcs.accessd at gmail.com Thu May 1 02:33:10 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 17:33:10 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Message-ID: Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge From shamil at smsconsulting.spb.ru Thu May 1 02:57:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 11:57:15 +0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <4818E198.30501@colbyconsulting.com> Message-ID: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> <<< No matter how you slice it, it has to process more physical disk sectors etc. >>> Hi John, Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' fields but it would be enough to scan index entries, and even maybe non-leaf index pages' entries for the query returning every 1000th row - then the difference I thought between the time to get results from 1+ million rows data table and 90 millions wouldn't be that significant. It's obvious now that that was my wrong assumption because clustered index has actual data rows on its leaf-nodes: Clustered Index http://msdn.microsoft.com/en-us/library/ms177443.aspx Non-Clustered Index http://msdn.microsoft.com/en-us/library/ms177484.aspx New hypothesis based on info on clustered and non-clustered index structure: With *Non-clustered* index defined for your PKID the following query performance should be significantly better. Although I'd not guess now how much time it could take to get this query finished with your db: SELECT RowNum, PKID from ( select Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID from [Names]) s where (s.RowNum % 1000) = 1 union all Select NULL as RowNum, Max(PKID) as PKID from [Names] When there exists a non-clustered index together with clustered for the same field and this field is used in a query as 'order by' or as selection criteria then MS SQL uses non-clustered index as far as I see from query execution plan... Here is how I did create non-clustered index to the test table called [dbo].[Names]: if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] GO CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] ( [PKID] ASC ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO (BTW, did you ever try to create non-clustered indexes on non-PRIMARY filegroups of an MS SQL 2000/2005 database? - another tip, which could improve query performance, especially if to keep indexes' filegroups on different HDDs - and the latter could be not backed-up because indexes can be rebuilt anytime, and building non-clustered indexes should be non that time consuming even for 90 million records DB? ) Please feel free to check or ignore the new hypothesis with your 90 million db table... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 1:16 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] vb.net - Updates I do have the clustered stuff exactly as you show: > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > IGNORE_DUP_KEY = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > ) ON [PRIMARY] Likewise I am getting the same 99% cost clustered index scan. I have to guess it is something else. There is a lot of empty space in the database file which I will compact out tonight. It takes hours because of the size and when it is doing that I cannot use the db. Perhaps I have severe fragmentation or something. The database size is 300 GIGS. And finally just remember that when all is said and done it is still a hundred times larger than your database. No matter how you slice it, it has to process more physical disk sectors etc. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu May 1 03:05:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 12:05:40 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: Message-ID: <034201c8ab62$25a2cc70$6401a8c0@nant> Hi Borge, Just remove these lines, which do not compile - those are attributes used internally by VB6: VBA has some similar attributes but you usually do not need to change them from within VBA's IDE.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Thursday, May 01, 2008 11:33 AM To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge _______________________________________________ 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 Thu May 1 03:14:43 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 10:14:43 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi William No don't. The article is about the _server_ side! /gustav >>> wdhindman at dejpolsystems.com 01-05-2008 09:24 >>> ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav From jwcolby at colbyconsulting.com Thu May 1 06:10:13 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 07:10:13 -0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <034201c8ab62$25a2cc70$6401a8c0@nant> References: <034201c8ab62$25a2cc70$6401a8c0@nant> Message-ID: <4819A515.9080300@colbyconsulting.com> Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 Thu May 1 06:27:39 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 15:27:39 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <4819A515.9080300@colbyconsulting.com> Message-ID: <036d01c8ab7e$5d8845e0$6401a8c0@nant> John, May I argue that Borge just needs to get VB6 code reused (copied and pasted) in his VBA project? Let's ask Borge? Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 3:10 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 pcs.accessd at gmail.com Thu May 1 07:08:11 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 22:08:11 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <036d01c8ab7e$5d8845e0$6401a8c0@nant> References: <4819A515.9080300@colbyconsulting.com> <036d01c8ab7e$5d8845e0$6401a8c0@nant> Message-ID: Hi guys, I was going to just say please disregard my post... But this is what happened: I have this HTTPClass.cls from http://www.paradoxes.info/code/HTTPClass.html We are using it to send data across the internet to a service provider who does Text To Speech (TTS) for us, then sends out phone calls, receives the keys press feed back from the clients - which in turn is sent back to us via another process ... used for identifying short term relief staff to fill short term vacancies in different industries .... So far I had been using the properties from a .dll created on the class and referenced into the VBA project. Questions came up about the format of the parameters we are sending across, so I had to start look into this thing and pick out the string that is actually being sent. So I thought I try and import the .cls into a class module and run the class in the VBA project so I can debug.print the POSTDATA string of the SendRequest function... (see the code on the website...) To answer your question: I did Insert > ClassModule > Pasted the Code from HTTPSClass.cls > Compiled Code > Saved the Class Module No problems! What prompted my question was that I had opened the .cls file in VisualStudio and it had added the Version and Attribute lines I was having problem with - which turns out is not part of the original .cls file and is totally unnecessary .. John and Shamil, thanks for responding... regards borge On Thu, May 1, 2008 at 9:27 PM, Shamil Salakhetdinov < shamil at smsconsulting.spb.ru> wrote: > John, > > May I argue that Borge just needs to get VB6 code reused (copied and > pasted) > in his VBA project? Let's ask Borge? > > Thanks. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 3:10 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Shamil, > > If you notice the Exposed and creatable properties, it appears that he > is trying to make the class viewable from outside of a library. Just > deleting those lines will prevent that. > > He needs to do the Insert Class, Insert file thing. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: > > Hi Borge, > > > > Just remove these lines, which do not compile - those are attributes > used > > internally by VB6: VBA has some similar attributes but you usually do > not > > need to change them from within VBA's IDE.... > > > > -- > > Shamil > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > > Sent: Thursday, May 01, 2008 11:33 AM > > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > > > Hi there, > > > > I am swimming in the deep end of the pool and threading water so to > speak > > .... I need help! > > > > I have imported a VB6 .cls file into VBA > > > > The following shows up in red and will not compile > > > > 'Will not compile : > > VERSION 1.0 CLASS > > > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > 'End of lines not compiling > > > > Here is the beginning of the module - it's the HTTPClass.cls from > available > > from some VB6 website, can't remember the link right now ...; > > all other code lines appear ok in VBA > > > > What do I need to do?? > > > > > > > > '**** Beginning of VBA Class Module :: > > Option Compare Database > > Option Explicit > > VERSION 1.0 CLASS > > BEGIN > > MultiUse = -1 'True > > Persistable = 0 'NotPersistable > > DataBindingBehavior = 0 'vbNone > > DataSourceBehavior = 0 'vbNone > > MTSTransactionMode = 0 'NotAnMTSObject > > End > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > > > Public Enum ePort > > INTERNET_DEFAULT_HTTP_PORT = 80 > > INTERNET_DEFAULT_HTTPS_PORT = 443 > > End Enum > > ... > > > > > > Regards > > borge > > _______________________________________________ > > 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 Thu May 1 07:10:05 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:10:05 -0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> References: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> Message-ID: <4819B31D.2060706@colbyconsulting.com> I have many indexes set up which include the PKID and one or more other fields. One would think that the optimizer would use one of those indexes instead of the clustered PKID index. I am thinking that a hint is in order to force SQL Server to use a different index. That is beyond my expertise however. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > <<< > No matter how you slice it, it has to process > more physical disk sectors etc. > Hi John, > > Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' > fields but it would be enough to scan index entries, and even maybe non-leaf > index pages' entries for the query returning every 1000th row - then the > difference I thought between the time to get results from 1+ million rows > data table and 90 millions wouldn't be that significant. It's obvious now > that that was my wrong assumption because clustered index has actual data > rows on its leaf-nodes: > > Clustered Index > http://msdn.microsoft.com/en-us/library/ms177443.aspx > > Non-Clustered Index > http://msdn.microsoft.com/en-us/library/ms177484.aspx > > > New hypothesis based on info on clustered and non-clustered index structure: > With *Non-clustered* index defined for your PKID the following query > performance should be significantly better. Although I'd not guess now how > much time it could take to get this query finished with your db: > > SELECT RowNum, PKID from ( select > Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID > from [Names]) s > where (s.RowNum % 1000) = 1 > union all > Select NULL as RowNum, Max(PKID) as PKID from [Names] > > When there exists a non-clustered index together with clustered for the same > field and this field is used in a query as 'order by' or as selection > criteria then MS SQL uses non-clustered index as far as I see from query > execution plan... > > Here is how I did create non-clustered index to the test table called > [dbo].[Names]: > > if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') > DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > GO > > CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > SORT_IN_TEMPDB = OFF, > IGNORE_DUP_KEY = OFF, > DROP_EXISTING = OFF, > ONLINE = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) > ON [PRIMARY] > GO > > (BTW, did you ever try to create non-clustered indexes on non-PRIMARY > filegroups of an MS SQL 2000/2005 database? - another tip, which could > improve query performance, especially if to keep indexes' filegroups on > different HDDs - and the latter could be not backed-up because indexes can > be rebuilt anytime, and building non-clustered indexes should be non that > time consuming even for 90 million records DB? ) > > Please feel free to check or ignore the new hypothesis with your 90 million > db table... > > Thank you. > > -- > Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 1:16 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] vb.net - Updates > > I do have the clustered stuff exactly as you show: > > > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > > ( > > [PKID] ASC > > ) > > WITH (PAD_INDEX = OFF, > > STATISTICS_NORECOMPUTE = OFF, > > IGNORE_DUP_KEY = OFF, > > ALLOW_ROW_LOCKS = ON, > > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > > ) ON [PRIMARY] > > Likewise I am getting the same 99% cost clustered index scan. > > I have to guess it is something else. There is a lot of empty space in > the database file which I will compact out tonight. It takes hours > because of the size and when it is doing that I cannot use the db. > Perhaps I have severe fragmentation or something. The database size is > 300 GIGS. And finally just remember that when all is said and done it > is still a hundred times larger than your database. No matter how you > slice it, it has to process more physical disk sectors etc. > > 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 jwcolby at colbyconsulting.com Thu May 1 07:37:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:37:44 -0400 Subject: [dba-VB] System not responding for seconds at a time Message-ID: <4819B998.40507@colbyconsulting.com> I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Thu May 1 08:28:46 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 01 May 2008 06:28:46 -0700 Subject: [dba-VB] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> Message-ID: <0K0600GA3YRY8146@vms173001.mailsrvcs.net> John, Try Process Explorer from SysInternals. It shows everything that's running on your machine. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx And yes SQL server does in fact take up a lot of memory when shrinking files. I would stop the sql server and the sql server agent using Services in Control Panel->Admin Tools but make sure it is not writing to the disk first. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 5:38 AM To: Discussion of Hardware and Software issues; VBA; Dba-Sqlserver Subject: [dba-VB] System not responding for seconds at a time I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- 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 jwcolby at colbyconsulting.com Thu May 1 08:30:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 09:30:44 -0400 Subject: [dba-VB] [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> Message-ID: <4819C604.4000901@colbyconsulting.com> Well... it appears that I have fixed the issue. After Googling "slow server response time" or something similar I ran across references to a "Maximum Memory" property for SQL Server. I finally found that and it was set to something insane like 200000000 MEGABYTES (several petabytes of server memory). While I can dream of such a machine, it ain't happening here! I adjusted the Maximum Memory down to 2 gigs and the "amount available" in Task Manager Performance tab popped up to 4 gigs. Having done that, and after perhaps 30 seconds, suddenly my machine is responding in a normal way. I am now adjusting that number to "leave" perhaps 2 gigs available to applications other than SQL Server. I probably don't even need 2 gigs but it is critical that I don't end up unable to do anything on that machine. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I don't quite know where to address this so I am cross posting it. I am > working on a fairly powerful server running Windows 2003 x64 and SQL > Server 2003 x64. It has 8 gigs of memory. No malware software, > software firewall, virus scanner etc. Nothing. > > I am running a file shrink on the SQL Server file, trying to remove > about 140 gigs of empty space. That process has been running since last > night, well over 8 hours now. It APPEARS that process is using all of > available memory since task manager shows only about 200 megs > "available". However if you look at the process tab, no process says it > is using more than 100 megs of ram. The performance tab shows almost no > CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then > only one of the cores appears to be doing anything. > > The computer is "stuttering" badly. Try to do anything - change to a > different program, page up in visual studios code etc, and the computer > will usually hesitate before doing whatever you requested. I am trying > to work on a VB project and can't get anything done because as I move > around in the doc it may take 2 to 5 seconds just to respond to my > request to move my cursor. > > Has anyone seen SQL Server lock up the the system like this, IOW is it > SQL Server? Does anyone know how long the file shrink could take - > days, weeks, months? Does anyone know how to cancel the file shrink? > This is the most powerful server I have, quad core, running x64 > software, 8 gigs, high speed raid arrays etc. > > Unfortunately I was in the middle of a vb.net project yesterday before I > started the shrink running after work and the server is unusable for > anything right now. > From accessd at shaw.ca Thu May 1 18:27:16 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 16:27:16 -0700 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux In-Reply-To: References: Message-ID: <803E0A4449764EF0AE3F013A4B9443AF@creativesystemdesigns.com> That is stellar news Gustav. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, April 30, 2008 11:29 PM To: The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav _______________________________________________ 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 May 2 06:00:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:00:19 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... Message-ID: <044901c8ac43$b6314e10$6401a8c0@nant> Hi All, Anybody lucky here to manage to find where to download "Classifieds Web Site Starter Kit"? The link on its web site hosted by MS http://www.asp.net/downloads/starter-kits/classifieds/ seems to be brokwen as well as on some other sites, which all refer this broken link. Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 06:08:42 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 07:08:42 -0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... References: <044901c8ac43$b6314e10$6401a8c0@nant> Message-ID: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 06:38:20 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:38:20 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... In-Reply-To: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Message-ID: <045001c8ac49$083bb560$6401a8c0@nant> Thank you, Michael! Yes, discountasp.net has a link, which leads to correct "Classifieds Web Site Starter Kit Download": http://download.microsoft.com/download/e/d/d/edd838dc-d369-403f-a5e0-d1ca2b5 be0be/class.vsi -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys Sent: Friday, May 02, 2008 3:09 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Classifieds Web Site Starter Kit Download... Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 08:53:11 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 17:53:11 +0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial on CodeProject Message-ID: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Hi All, I have found the following article as a good source on WinForms databinding with custom classes: A Detailed WinForns Data Binding Tutorial http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx Was it mentioned here already? Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 10:31:28 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 11:31:28 -0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject References: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Message-ID: <00ce01c8ac69$9825b250$0502a8c0@Laptop> Hi Shamil, No, I hadn't seen this before. Thank you! Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 9:53 AM Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject > Hi All, > > I have found the following article as a good source on WinForms > databinding > with custom classes: > > A Detailed WinForns Data Binding Tutorial > > http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx > > Was it mentioned here already? > > Thank you. > > -- > Shamil > > _______________________________________________ > 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 May 2 12:35:52 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:35:52 -0400 Subject: [dba-VB] Visual Studio 2008 Message-ID: <481B50F8.5020202@colbyconsulting.com> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 2 12:43:58 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 02 May 2008 19:43:58 +0200 Subject: [dba-VB] Visual Studio 2008 Message-ID: Hi John I have both installed. Only task on Vista was to download and install a large update for VS2005 which it announces when the initial install has finished. /gustav >>> jwcolby at colbyconsulting.com 02-05-2008 19:35 >>> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri May 2 12:47:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:47:26 -0400 Subject: [dba-VB] Visual Studio 2008 In-Reply-To: <481B50F8.5020202@colbyconsulting.com> References: <481B50F8.5020202@colbyconsulting.com> Message-ID: <481B53AE.4080802@colbyconsulting.com> Other than learn how to spell? ;-) John W. Colby www.ColbyConsulting.com jwcolby wrote: > Can VS2008 co-habitate with 2005? Andything special I need to do? > From Gustav at cactus.dk Sun May 4 02:23:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 09:23:53 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi all What do you use as feed for the Start Page? If any? I noticed that neither in VS2005 nor VS2008 the Start Page has been updated since the initial install. In VS2008 this URL is created: http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 It links to: http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml which has a last entry of Mar. 20th. That explains. But why does VS install this? I located via Google another feed: http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml which seems to update. But that is not C#. /gustav From wdhindman at dejpolsystems.com Sun May 4 02:45:49 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 4 May 2008 03:45:49 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <4E8801746B1B499B88AD78BD3B3E542F@jislaptopdev> ...nice find Gustav ...I'd just eliminated the start page altogether ...I'll have to give this a shot :) William -------------------------------------------------- From: "Gustav Brock" Sent: Sunday, May 04, 2008 3:23 AM To: " Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From mmattys at rochester.rr.com Sun May 4 06:53:16 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 07:53:16 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <002501c8addd$71922540$0502a8c0@Laptop> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /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 Sun May 4 07:01:35 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 04 May 2008 08:01:35 -0400 Subject: [dba-VB] SQL Server timeouts Message-ID: <481DA59F.5060503@colbyconsulting.com> I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Sun May 4 07:46:05 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 08:46:05 -0400 Subject: [dba-VB] SQL Server timeouts References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <005401c8ade4$d20375d0$0502a8c0@Laptop> While I was on Amazon a few days ago, the key word "Tuning" caught my eye - - so I looked it up. This might help, but do Google: http://www.codeproject.com/KB/database/sql-tuning-tutorial-1.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: "VBA" ; "Dba-Sqlserver" Sent: Sunday, May 04, 2008 8:01 AM Subject: [dba-VB] SQL Server timeouts >I am running this process that updates SQL Server from VB.Net. The > process runs normally for tens of millions of records, then SQL Server > "hangs" and stops servicing requests (from this process), either reads > or writes. It just times out with error messages "Timeout Expired: The > timeout period expired prior to completion of the operation or SQL > Server is not responding". > > This is not a once off occurrence, it happens every time I start the > process running. Sometimes I get this and then eventually SQL Server > will start responding, sometimes it just stops responding. > > How do I troubleshoot this? > -- > 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 mikedorism at verizon.net Sun May 4 08:07:01 2008 From: mikedorism at verizon.net (Doris Manning) Date: Sun, 04 May 2008 09:07:01 -0400 Subject: [dba-VB] SQL Server timeouts In-Reply-To: <481DA59F.5060503@colbyconsulting.com> References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <000901c8ade7$be7d6a40$2d01a8c0@Kermit> The culprit is probably a system database called "tempdb". This database gets reset each time you stop and restart SQL Server. In my world, I had to create a job to shrink it every hour in order to resolve this issue. http://sqlserver2000.databases.aspfaq.com/why-is-tempdb-full-and-how-can-i-p revent-this-from-happening.html Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, May 04, 2008 8:02 AM To: VBA; Dba-Sqlserver Subject: [dba-VB] SQL Server timeouts I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- 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 Gustav at cactus.dk Sun May 4 08:39:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 15:39:07 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi Michael Some typos here? Should be, I guess: http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 Links to: http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml /gustav >>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav From mmattys at rochester.rr.com Sun May 4 09:30:11 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 10:30:11 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <006801c8adf3$5cf9c4b0$0502a8c0@Laptop> Sorry, working from two laptops ... one connected, one protected. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: Sent: Sunday, May 04, 2008 9:39 AM Subject: Re: [dba-VB] VS Start Page feed > Hi Michael > > Some typos here? Should be, I guess: > http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 > > Links to: > http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml > > /gustav > >>>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> > Mine says: > > (Last update Fri., May 2) > http://go.microsoft.com/flink/?linkid45191&clcid=409 > > Michael R. Mattys > MapPoint & Access Dev > www.mattysconsulting.com > > ----- Original Message ----- > From: "Gustav Brock" > To: " > Sent: Sunday, May 04, 2008 3:23 AM > Subject: [dba-VB] VS Start Page feed > > >> Hi all >> >> What do you use as feed for the Start Page? If any? >> >> I noticed that neither in VS2005 nor VS2008 the Start Page has been >> updated since the initial install. >> In VS2008 this URL is created: >> >> http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 >> >> It links to: >> >> http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml >> >> which has a last entry of Mar. 20th. >> That explains. But why does VS install this? >> >> I located via Google another feed: >> >> http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml >> >> which seems to update. But that is not C#. >> >> /gustav > > > > _______________________________________________ > 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 May 5 08:03:23 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 17:03:23 +0400 Subject: [dba-VB] FYI: Programming ftp in .NET Message-ID: <05ed01c8aeb0$68210250$6401a8c0@nant> Hi All, It happens that basic FTP access - login, change dir, upload and download can be relatively easy programmed by using this free code - http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm ... I have found just one issue: while uploading a file having left or right curly bracket - '{' or '}' in ASCII mode I'm getting "Input line wasn't in correct format" runtime error on this code line: public class FTPClient ... private void PutASCII(Stream srcStream, string remoteFile, bool append) ... writer.Write(line, 0, line.Length); ... When I make curly bracket duplicated then it works well, but then download doesn't work again breaking on curly bracket... Have you seen issues like that? (I guess I have here FTP protocol specs violation in the case of curly brackets?) In BINARY mode everything seems to work well, therefore issue isn't that critical still I'd be interested to know what other chars could result in runtime errors? And how to properly escape curly brackets to implement FTP put and get in ASCII mode.... BTW, in P.S. you can find simple C# Windows Console app FTP test of the referred above free source Thanks. -- Shamil P.S. using System; using System.Collections.Generic; using System.Text; using com.enterprisedt.net.ftp; using FTP; namespace FTPTestConsole { class Program { private static void logger_OnLoggableEvent(object o, LogInfoEventArgs e) { //lbProgress.Items.Add(e.Message); //lbProgress.SelectedIndex = lbProgress.Items.Count - 1; //Application.DoEvents(); Console.WriteLine(e.Message); } private static string _host = "{{yourHostHere}}"; private static string _userId = "{{yourUserNameHere}}"; private static string _password = "{{yourPasswordHere}}"; private static string _ftpFolder = "testUp"; private static string _localUploadedFileFullPath = @"E:\temp\up.txt"; private static string _localDownloadedFileFullPath = @"E:\temp\OK.txt"; private static string _remoteFileName = "test.txt"; static void Main(string[] args) { try { // Create and register a logger FTP.Logger logger = new FTP.Logger(); //logger.OnLoggableEvent += new FTP.Logger.LoggableEventHandler(logger_OnLoggableEvent); logger.OnLoggableEvent += new Logger.LoggableEventHandler(logger_OnLoggableEvent); // create an instance of FTPClient, passing in the name of hte host, the time out // and the logger for updates string host = _host; com.enterprisedt.net.ftp.FTPClient ftpClient = new com.enterprisedt.net.ftp.FTPClient(host); // call login, passing in the user id and the password string user = _userId; string pw = _password; ftpClient.Login(user, pw); // change directory on the host logger.Write(null, "Client requesting change directory to " + _ftpFolder); string newDirectory = _ftpFolder; ftpClient.Chdir(newDirectory); // send a file to the host (rename it there) logger.Write(null, "Client calling Put(" + _localUploadedFileFullPath + "," + _remoteFileName + ")"); string localFileName = _localUploadedFileFullPath; string remoteFileName = _remoteFileName; //ftpClient.Put(localFileName, remoteFileName); ftpClient.TransferType = FTPTransferType.BINARY; ftpClient.Put(localFileName, remoteFileName); // ge the file back from the host, rename it here logger.Write(null, "Client calling Get(" + _localDownloadedFileFullPath + "," + _remoteFileName + ")"); string newFileName = _localDownloadedFileFullPath; ftpClient.Get(newFileName, remoteFileName); // clean up and go home logger.Write(null, "Client calling quit"); ftpClient.Quit(); logger.Write(null, "Done."); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } } From jwcolby at colbyconsulting.com Mon May 5 08:06:01 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 09:06:01 -0400 Subject: [dba-VB] SQL Server WHERE Clause order Message-ID: <481F0639.2090300@colbyconsulting.com> Does it make any difference in SQL Server the order of the WHERE clause items. For example: WHERE (LastName IS NOT NULL) AND (AGE > 30) vs WHERE (AGE > 30) AND (LastName IS NOT NULL) -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:23:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:23:26 -0400 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: <481F266E.9020104@colbyconsulting.com> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:41:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:41:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F2AAB.7060109@colbyconsulting.com> When I type ?string.format("yyyyMMdd",Date.Today) into the debug window I get yyyyMMdd (the literal string) not 20080505. What am I doing wrong? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 10:43:08 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 19:43:08 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> Message-ID: <061d01c8aec6$b73dafd0$6401a8c0@nant> Hi John, This should be it: Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) Console.WriteLine(dt) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:23 PM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 mikedorism at verizon.net Mon May 5 10:46:24 2008 From: mikedorism at verizon.net (Doris Manning) Date: Mon, 05 May 2008 11:46:24 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <000601c8aec7$2cc87a00$2d01a8c0@Kermit> JC, Try using... Format(Date.Now, "yyyyMMdd-hhmmss") Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 11:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Gustav at cactus.dk Mon May 5 10:51:41 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 05 May 2008 17:51:41 +0200 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: Hi John Here's a good reference on date format strings with lots of samples: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx /gustav >>> jwcolby at colbyconsulting.com 05-05-2008 17:23 >>> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:59:03 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:59:03 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <061d01c8aec6$b73dafd0$6401a8c0@nant> References: <061d01c8aec6$b73dafd0$6401a8c0@nant> Message-ID: <481F2EC7.8020700@colbyconsulting.com> Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 11:17:13 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 20:17:13 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <062401c8aecb$7a495700$6401a8c0@nant> OK - DateTime.Now.ToString("yyyyMMdd-hhmmss") should work well also. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Mon May 5 11:40:43 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 5 May 2008 09:40:43 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <003801c8aece$c32188f0$0200a8c0@murphy3234aaf1> Hi John, I have an app that does something similar with wav files. What I use to time stamp the files is to use the time as the file name as follows. sFileName = sFolder & CStr(DatePart("h", Now)) & "_" & CStr(DatePart("n", Now)) & "_" & CStr(DatePart("s", Now)) & ".wav" May not be elegant but it works. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Mon May 5 11:46:42 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 5 May 2008 09:46:42 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: I would strongly suggest you use an underscore rather than a hyphen in your file name. We've encountered various situations where the hyphen is treated as an invalid character, particularly when transferring files electronically. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com _______________________________________________ From jwcolby at colbyconsulting.com Mon May 5 12:07:37 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 13:07:37 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F3ED9.9020100@colbyconsulting.com> I can do that. Thanks. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > I would strongly suggest you use an underscore rather than a hyphen in > your file name. We've encountered various situations where the hyphen > is treated as an invalid character, particularly when transferring files > electronically. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 8:23 AM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > > -- > 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 jwcolby at colbyconsulting.com Tue May 6 15:50:18 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 May 2008 16:50:18 -0400 Subject: [dba-VB] SP1 - how do you tell Message-ID: <4820C48A.4060406@colbyconsulting.com> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue May 6 16:00:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 May 2008 23:00:07 +0200 Subject: [dba-VB] SP1 - how do you tell Message-ID: Hi John Mine tells: Version 8.0.50727.867 (vvista.050727-8600) /gustav >>> jwcolby at colbyconsulting.com 06-05-2008 22:50 >>> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed May 7 06:53:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 May 2008 15:53:15 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <07c101c8b038$ef88b470$6401a8c0@nant> Hi John, Please make correction to your string formatting: Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) Console.WriteLine(dt) IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the hour value in 00 - 11 range, and you might get file names collisions: yes, very low probability to get such collisions but "Murphy Laws" are waiting us, developers, around every corner, you know, and we have to be very accurate, and a little bit "paranoid"... Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ 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 May 7 07:05:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 07 May 2008 08:05:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <07c101c8b038$ef88b470$6401a8c0@nant> References: <07c101c8b038$ef88b470$6401a8c0@nant> Message-ID: <48219B0B.7040901@colbyconsulting.com> Thanks for that Shamil. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Please make correction to your string formatting: > > Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) > Console.WriteLine(dt) > > IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the > hour value in 00 - 11 range, and you might get file names collisions: yes, > very low probability to get such collisions but "Murphy Laws" are waiting > us, developers, around every corner, you know, and we have to be very > accurate, and a little bit "paranoid"... > > Thanks. > > -- > Shamil From max.wanadoo at gmail.com Thu May 8 02:42:37 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 8 May 2008 08:42:37 +0100 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <05ed01c8aeb0$68210250$6401a8c0@nant> References: <05ed01c8aeb0$68210250$6401a8c0@nant> Message-ID: <000301c8b0df$16739bd0$8119fea9@LTVM> Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max From fhtapia at gmail.com Thu May 8 08:08:28 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 06:08:28 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: I am in the middle of testing it, I will post back when I have completed my tests On 5/8/08, Max Wanadoo wrote: > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From dwaters at usinternet.com Thu May 8 08:12:07 2008 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 8 May 2008 08:12:07 -0500 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: <001301c8b10d$1e4579e0$0300a8c0@danwaters> When I tried to install it by the normal method, I got an 'Access Denied' error during installation. It did gracefully uninstall all the SP3 files and I'm back to where I was no worse for the wear. I downloaded the update (about 30 minutes w/DSL) and I'll try next with that. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Thursday, May 08, 2008 2:43 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] XP Service Pack 3 and Access Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max _______________________________________________ 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 Thu May 8 11:29:49 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 08 May 2008 18:29:49 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From jwcolby at colbyconsulting.com Thu May 8 13:05:06 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 08 May 2008 14:05:06 -0400 Subject: [dba-VB] Dual boot Server 2003 X32 and x64 Message-ID: <482340D2.5090608@colbyconsulting.com> Does anyone know if it is possible to dual boot the x32 and x64 version of windows 2k3? My concern in doing so is that on the one server that I run 2k3 x64 on, there are two program file directories, one called Program Files the other called Program Files (x86). It APPEARS that the (x86) directory is the 32 bit directory which would imply that the one without was the x64, though I have nothing more to base that on than the names of the directories inside of each Program Files directory. I just got a 2nd Phenom quad core and want to convert a second system to quad core x64. The EASIEST way would be to dual boot until I have everything I need running in x64 and then cut over. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu May 8 13:47:26 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 11:47:26 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <001301c8b10d$1e4579e0$0300a8c0@danwaters> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> <001301c8b10d$1e4579e0$0300a8c0@danwaters> Message-ID: I downloaded the file straight from the download center and did a normal install On Thu, May 8, 2008 at 6:12 AM, Dan Waters wrote: > When I tried to install it by the normal method, I got an 'Access Denied' > error during installation. It did gracefully uninstall all the SP3 files > and I'm back to where I was no worse for the wear. > > I downloaded the update (about 30 minutes w/DSL) and I'll try next with > that. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo > Sent: Thursday, May 08, 2008 2:43 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: [dba-VB] XP Service Pack 3 and Access > > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From mikedorism at verizon.net Thu May 8 16:43:29 2008 From: mikedorism at verizon.net (Doris Manning) Date: Thu, 08 May 2008 17:43:29 -0400 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: <001801c8b154$8e4561a0$2d01a8c0@Kermit> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Thu May 8 17:14:14 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 00:14:14 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Thu May 8 17:47:10 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 8 May 2008 15:47:10 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 May 9 03:50:12 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 10:50:12 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /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 Gustav at cactus.dk Fri May 9 05:36:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 12:36:19 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From Gustav at cactus.dk Fri May 9 06:22:33 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 13:22:33 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Here's a simple dirty trick to force a validate of a CheckBox: Hide the checkbox, Show it again and set Focus. As the control looses focus, Validating and Validated will fire. The previous control will get focus. You show the control again and move focus back (and the Validating and Validated events of the previous control will fire). It happens so fast that nothing strange is to be seen for the user. private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.checkBoxRegistered.Hide(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Show(); this.checkBoxRegistered.Focus(); // Focus has been retained. // Validating and Validated of the previous control will fire. } Another option is to have a tiny dummy control containing no event code where focus temporarily can be stoved away: private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.noop.Focus(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Focus(); // Focus has been regained. // Validating and Validated of the dummy control will fire. } /gustav >>> Gustav at cactus.dk 09-05-2008 10:50 >>> Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Fri May 9 10:45:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 9 May 2008 08:45:06 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.as px The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Mon May 12 14:50:05 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 12 May 2008 21:50:05 +0200 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... Message-ID: Hi all Anyone encountered this nasty bug? It seems to have lived for years(!): http://forums.microsoft.com/msdn/showpost.aspx?postid=277680&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=10 I have a Winform with a DataGridView and some bound textboxes. Data source is a DataTable. Update goes like this: this.Validate(true); this.mediaBindingSource.EndEdit(); this.mediaTableAdapter.Update(this.MyAdapter.Media); Sometimes after multiple but not stressed updates, the exception error is raised. Any ideas or workarounds? /gustav From mikedorism at verizon.net Tue May 13 06:15:30 2008 From: mikedorism at verizon.net (Doris Manning) Date: Tue, 13 May 2008 07:15:30 -0400 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... In-Reply-To: References: Message-ID: <000001c8b4ea$a88b7d80$2d01a8c0@Kermit> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Doris It doesn't. However, I think I tracked down the issue after much trial and error. It happens if you perform multiple updates of the same row when an update is called immediately following each value change of several controls via the GUI. By only performing one update for each row, the issue seems to stay dormant. /gustav >>> mikedorism at verizon.net 13-05-2008 13:15 >>> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Charlotte and Doris I've found that if you bind a DataTable to a non-tristate CheckBox and try to insert a new row having set Checked to either True or False but without specifying the CheckState property, the insert will fail because CheckState will pass a DBNull to the DataTable. Thus, you must bind the CheckState property to the DataTable and - for a new record - set CheckState to either Checked or Unchecked. /gustav >>> cfoust at infostatsystems.com 09-05-2008 17:45 >>> We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From shamil at smsconsulting.spb.ru Tue May 20 12:29:50 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 21:29:50 +0400 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN In-Reply-To: <4812075D.6000306@colbyconsulting.com> Message-ID: <11cb01c8ba9f$1c873ad0$6401a8c0@nant> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- 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 shamil at smsconsulting.spb.ru Tue May 20 14:16:41 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 23:16:41 +0400 Subject: [dba-VB] Fail Fast Message-ID: <11e301c8baae$08c911d0$6401a8c0@nant> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From cfoust at infostatsystems.com Tue May 20 14:32:37 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 May 2008 12:32:37 -0700 Subject: [dba-VB] Fail Fast In-Reply-To: <11e301c8baae$08c911d0$6401a8c0@nant> References: <11e301c8baae$08c911d0$6401a8c0@nant> Message-ID: Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 Wed May 21 16:48:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 22 May 2008 01:48:22 +0400 Subject: [dba-VB] Fail Fast In-Reply-To: Message-ID: <137801c8bb8c$649cc3b0$6401a8c0@nant> Hi Charlotte, Thank you for sharing your experience on the subject. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, May 20, 2008 11:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Fail Fast Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 paul.hartland at googlemail.com Fri May 23 06:25:46 2008 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 23 May 2008 12:25:46 +0100 Subject: [dba-VB] Using MapPoint To Get Driving Distance Message-ID: <38c884770805230425k514699dcq1fadc18ee59e7184@mail.gmail.com> To all, I am trying to get driving distance from MapPoint 2006 using Visual Basic 6.0, which I have done. The problem being that it takes roughly two seconds to retrieve the distance. Has anyone had any experience of doing something similar and could possibly point me in the right direction of finding a faster way. Two seconds doesn't sound like a long time, but when we want to schedule about 30 people on a job, this adds around a minute to get the distance's from the employees postcode to the client's postcode. Also I am having trouble with some postcodes especially BT8 (Ireland), if you type BT8 it will not find the location, however if you put the address in it finds it and shows the postcode as BT8, where in Google maps it will find BT8 without a problem. Thank you in advance for any help on this matter..... -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri May 23 13:00:22 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:00:22 +0200 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN Message-ID: Hi Shamil Thanks for that link. As I read it, Bazaar could be the choice: http://bazaar-vcs.org However, not a single word of integration with Visual Studio except for a "dead" plug-in for VS2005 ... To me, that settles it. No Bazaar for me. Anyone with some experience of Bazaar? /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 19:29 >>> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 23 13:35:37 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:35:37 +0200 Subject: [dba-VB] Fail Fast Message-ID: Hi Shamil I like that approach, actually I once had the idea that error messages should be localized ... The article mentions an example of the type: On Error .. let value of variable x = 10 That is plain bad code in my opinion and makes a discussion on what approach to use difficult. However, when I think about it - encouraged by your posting - in Access I don't use error handling that much and mostly on a general level to catch disk/network errors and the like. I run so many tests on various user inputs during development that the code is virtually bug free. Well, of course not, but the level is so low that it doesn't pay off to do more about it. In most installations of our software we see zero errors a year caused by the software itself. Errors met are caused by network or hardware malfunction. With Visual Studio it is different but similar. I've found that when an error is raised, the message is so informative that I don't need more information. Also the stack window is a great help and - again - the IDE of VS demonstrated its superiority at a surprising level when I noticed the first time that code lines with jumps to other code modules are highlighted. Of course I include a try/catch here and there but I prefer to check for potential errors - like a lost connection before running a major update routine. Further, to my surprise, VS lets some errors pass which don't have to stop the code, indeed formatting errors for empty strings. This is certainly an indication of a value not intended, so I turned on the setting that will raise an error in such cases. Put a check mark in Thrown here: Debug, Exceptions ..., Common Language Runtime Exceptions, System, System.FormatException /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 21:16 >>> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri May 23 18:03:51 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 May 2008 19:03:51 -0400 Subject: [dba-VB] CDO Email Message-ID: <48374D57.2060502@colbyconsulting.com> Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Sat May 24 11:05:54 2008 From: ebarro at verizon.net (Eric Barro) Date: Sat, 24 May 2008 09:05:54 -0700 Subject: [dba-VB] CDO Email In-Reply-To: <48374D57.2060502@colbyconsulting.com> References: <48374D57.2060502@colbyconsulting.com> Message-ID: <001f01c8bdb8$0f922fd0$1003000a@advancedinput.com> When you send via your forwarding SMTP server using Thunderbird are you sending (via the email client) authentication? I have to assume that most SMTP servers today expect both username and password to authenticate before they even allow you to send mail out via the SMTP service. There's a setting for authentication that you need to send. mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti cate", 1); ' set to authenticate mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername ", uxSMTPUser.Text); 'send the smtp username mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword ", uxSMTPPassword.Text); 'send the smtp password You can adapt that .NET code for your use. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, May 23, 2008 4:04 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] CDO Email Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- 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 jwcolby at colbyconsulting.com Thu May 29 11:19:47 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 12:19:47 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTE classification-tree editor In-Reply-To: References: Message-ID: <483ED7A3.1070206@colbyconsulting.com> I had a very interesting conversation with my tax guy this morning. He had previously worked at Lowes Hardware in their accounting department. The upshot of the conversation was that Lowes has to interface to a huge number of legacy systems, systems from suppliers, banks, systems from companies they purchased 10 years ago and inherited etc. His comment of interest is that in many cases they did not do testing. Or more correctly they threw data at the live system and looked at what happened, and then used a feedback loop to work around to what the system at the other end would accept. Sounds like poor Roz at her current assignment. I have to tell you that I have experienced this same thing. My disability insurance call center software has to interface to about 10 (so far) completely different insurance companies. Each company has dozens of legacy systems. We get "specs" for how to receive and transmit data to these mainframe systems. I write code to meet the spec, then we send data. We then get feedback from them about how to change the program to meet the "REAL spec" which is never the printed spec. Iterate until the feedback stops and they start accepting what we send without complaint. In one case they had specified how to output claim data that they wanted to enter into their system. In this one (admittedly extreme) case it was in a vertical report format, which we did. Some six months later we discovered that the format was designed to allow some key entry person to key it into their system manually, and the "report order" was the order that the data entry fields appeared on her screen. I got a chuckle out of that one. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > A local computer paper brought attention to this work related to Daimler-Chrysler but useful in many areas: > > http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 > > > This page contains papers on the classification-tree method CTM and the classification-tree editor CTE. The classification-tree method is a testing method for the systematic design of test cases on basis of the specification. The classification-tree editor is a graphical editor supporting the application of the classification-tree method. CTM and CTE are widely used in industrial practice. > > > The CTE software is free to download and use and the page contains links to a bunch of documentation. > Here's an intro: > > http://www.systematic-testing.com/documents/eurostar2000.pdf > > > > > From wdhindman at dejpolsystems.com Thu May 29 15:04:31 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 29 May 2008 16:04:31 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: ...I thought that's how everyone does it :) William "The truth is incontrovertible, malice may attack it, ignorance may deride it, but in the end; there it is." -------------------------------------------------- From: "jwcolby" Sent: Thursday, May 29, 2008 12:19 PM To: "Access Developers discussion and problem solving" ; "VBA" ; "Discussion of Hardware and Software issues" Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor > I had a very interesting conversation with my tax guy this > morning. He had previously worked at Lowes Hardware in > their accounting department. > > The upshot of the conversation was that Lowes has to > interface to a huge number of legacy systems, systems from > suppliers, banks, systems from companies they purchased 10 > years ago and inherited etc. His comment of interest is > that in many cases they did not do testing. Or more > correctly they threw data at the live system and looked at > what happened, and then used a feedback loop to work around > to what the system at the other end would accept. > > Sounds like poor Roz at her current assignment. > > I have to tell you that I have experienced this same thing. > My disability insurance call center software has to > interface to about 10 (so far) completely different > insurance companies. Each company has dozens of legacy > systems. > > We get "specs" for how to receive and transmit data to these > mainframe systems. I write code to meet the spec, then we > send data. We then get feedback from them about how to > change the program to meet the "REAL spec" which is never > the printed spec. Iterate until the feedback stops and they > start accepting what we send without complaint. > > In one case they had specified how to output claim data that > they wanted to enter into their system. In this one > (admittedly extreme) case it was in a vertical report > format, which we did. Some six months later we discovered > that the format was designed to allow some key entry person > to key it into their system manually, and the "report order" > was the order that the data entry fields appeared on her screen. > > I got a chuckle out of that one. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi all >> >> A local computer paper brought attention to this work related to >> Daimler-Chrysler but useful in many areas: >> >> http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 >> >> >> This page contains papers on the classification-tree method CTM and the >> classification-tree editor CTE. The classification-tree method is a >> testing method for the systematic design of test cases on basis of the >> specification. The classification-tree editor is a graphical editor >> supporting the application of the classification-tree method. CTM and CTE >> are widely used in industrial practice. >> >> >> The CTE software is free to download and use and the page contains links >> to a bunch of documentation. >> Here's an intro: >> >> http://www.systematic-testing.com/documents/eurostar2000.pdf >> >> >> >> >> > _______________________________________________ > 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 Thu May 29 15:09:34 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 16:09:34 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor In-Reply-To: References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: <483F0D7E.6090905@colbyconsulting.com> > ...I thought that's how everyone does it :) The bigger the company the more likely that is how it is done. John W. Colby www.ColbyConsulting.com William Hindman wrote: > ...I thought that's how everyone does it :) > > William > "The truth is incontrovertible, malice may attack it, ignorance may deride > it, but in the end; there it is." > > -------------------------------------------------- > From: "jwcolby" > Sent: Thursday, May 29, 2008 12:19 PM > To: "Access Developers discussion and problem solving" > ; "VBA" ; > "Discussion of Hardware and Software issues" > Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: > CTEclassification-tree editor > >> I had a very interesting conversation with my tax guy this >> morning. He had previously worked at Lowes Hardware in >> their accounting department. >> >> The upshot of the conversation was that Lowes has to >> interface to a huge number of legacy systems, systems from >> suppliers, banks, systems from companies they purchased 10 >> years ago and inherited etc. His comment of interest is >> that in many cases they did not do testing. Or more >> correctly they threw data at the live system and looked at >> what happened, and then used a feedback loop to work around >> to what the system at the other end would accept. >> >> Sounds like poor Roz at her current assignment. >> >> I have to tell you that I have experienced this same thing. >> My disability insurance call center software has to >> interface to about 10 (so far) completely different >> insurance companies. Each company has dozens of legacy >> systems. >> >> We get "specs" for how to receive and transmit data to these >> mainframe systems. I write code to meet the spec, then we >> send data. We then get feedback from them about how to >> change the program to meet the "REAL spec" which is never >> the printed spec. Iterate until the feedback stops and they >> start accepting what we send without complaint. >> >> In one case they had specified how to output claim data that >> they wanted to enter into their system. In this one >> (admittedly extreme) case it was in a vertical report >> format, which we did. Some six months later we discovered >> that the format was designed to allow some key entry person >> to key it into their system manually, and the "report order" >> was the order that the data entry fields appeared on her screen. >> >> I got a chuckle out of that one. >> >> John W. Colby >> www.ColbyConsulting.com From ebarro at verizon.net Thu May 29 20:25:25 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 29 May 2008 18:25:25 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <483F0D7E.6090905@colbyconsulting.com> References: <483ED7A3.1070206@colbyconsulting.com> <483F0D7E.6090905@colbyconsulting.com> Message-ID: <000001c8c1f4$0b018890$c403000a@advancedinput.com> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 02:21:02 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 09:21:02 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From shamil at smsconsulting.spb.ru Fri May 30 07:45:55 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 16:45:55 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: Message-ID: <000c01c8c253$1a39aa40$6401a8c0@nant> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 09:09:15 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 30 May 2008 15:09:15 +0100 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000c01c8c253$1a39aa40$6401a8c0@nant> References: <000c01c8c253$1a39aa40$6401a8c0@nant> Message-ID: <000201c8c25e$c1073ad0$8119fea9@LTVM> It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 10:42:54 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 19:42:54 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000201c8c25e$c1073ad0$8119fea9@LTVM> Message-ID: <000c01c8c26b$d393d7f0$6401a8c0@nant> Hi Max, Yes, this is why I'm wondering what Gustav means :) BTW, I do use multi-layered approach with a lot of custom classes and mainly ObjectDataSource controls for ASP.NET web forms - works very well but it needs one or another code generation tool: I did develop my own but maybe you'd better purchase existing ones if you do not have time to develop your own... For the task like yours (assuming ObjectDataSource and custom classes are used) I'd batch updates into transactions - that will need some more work than built-in approach you're trying to use but when that custom approach is used ((generated) custom classes + ObjectDataSource control + a few custom coding) then you have control on every bit of your program and you're not dependent on any new technologies MS will develop, and with some more efforts you can have different backends SQL Servers or even MS Access for different customers of the same application etc. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Friday, May 30, 2008 6:09 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Updating dataset from datagrid It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 cfoust at infostatsystems.com Fri May 30 10:50:58 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 May 2008 08:50:58 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000001c8c1f4$0b018890$c403000a@advancedinput.com> References: <483ED7A3.1070206@colbyconsulting.com><483F0D7E.6090905@colbyconsulting.com> <000001c8c1f4$0b018890$c403000a@advancedinput.com> Message-ID: I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 11:32:18 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 18:32:18 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Charlotte and Eric Exactly. It will even write pass-through queries for the asking. /gustav >>> cfoust at infostatsystems.com 30-05-2008 17:50 >>> I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 12:01:04 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 19:01:04 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav From Gustav at cactus.dk Thu May 1 01:28:56 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 08:28:56 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi all This should be doable as Novell claims Mono to be 100% compatible with ASP.NET. A two-page how-to guide is published here: http://novellevents.novell.com/t/5096990/63304383/9281/0/ The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav From wdhindman at dejpolsystems.com Thu May 1 02:24:15 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 1 May 2008 03:24:15 -0400 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux References: Message-ID: ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From pcs.accessd at gmail.com Thu May 1 02:33:10 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 17:33:10 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Message-ID: Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge From shamil at smsconsulting.spb.ru Thu May 1 02:57:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 11:57:15 +0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <4818E198.30501@colbyconsulting.com> Message-ID: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> <<< No matter how you slice it, it has to process more physical disk sectors etc. >>> Hi John, Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' fields but it would be enough to scan index entries, and even maybe non-leaf index pages' entries for the query returning every 1000th row - then the difference I thought between the time to get results from 1+ million rows data table and 90 millions wouldn't be that significant. It's obvious now that that was my wrong assumption because clustered index has actual data rows on its leaf-nodes: Clustered Index http://msdn.microsoft.com/en-us/library/ms177443.aspx Non-Clustered Index http://msdn.microsoft.com/en-us/library/ms177484.aspx New hypothesis based on info on clustered and non-clustered index structure: With *Non-clustered* index defined for your PKID the following query performance should be significantly better. Although I'd not guess now how much time it could take to get this query finished with your db: SELECT RowNum, PKID from ( select Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID from [Names]) s where (s.RowNum % 1000) = 1 union all Select NULL as RowNum, Max(PKID) as PKID from [Names] When there exists a non-clustered index together with clustered for the same field and this field is used in a query as 'order by' or as selection criteria then MS SQL uses non-clustered index as far as I see from query execution plan... Here is how I did create non-clustered index to the test table called [dbo].[Names]: if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] GO CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] ( [PKID] ASC ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO (BTW, did you ever try to create non-clustered indexes on non-PRIMARY filegroups of an MS SQL 2000/2005 database? - another tip, which could improve query performance, especially if to keep indexes' filegroups on different HDDs - and the latter could be not backed-up because indexes can be rebuilt anytime, and building non-clustered indexes should be non that time consuming even for 90 million records DB? ) Please feel free to check or ignore the new hypothesis with your 90 million db table... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 1:16 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] vb.net - Updates I do have the clustered stuff exactly as you show: > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > IGNORE_DUP_KEY = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > ) ON [PRIMARY] Likewise I am getting the same 99% cost clustered index scan. I have to guess it is something else. There is a lot of empty space in the database file which I will compact out tonight. It takes hours because of the size and when it is doing that I cannot use the db. Perhaps I have severe fragmentation or something. The database size is 300 GIGS. And finally just remember that when all is said and done it is still a hundred times larger than your database. No matter how you slice it, it has to process more physical disk sectors etc. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu May 1 03:05:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 12:05:40 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: Message-ID: <034201c8ab62$25a2cc70$6401a8c0@nant> Hi Borge, Just remove these lines, which do not compile - those are attributes used internally by VB6: VBA has some similar attributes but you usually do not need to change them from within VBA's IDE.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Thursday, May 01, 2008 11:33 AM To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge _______________________________________________ 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 Thu May 1 03:14:43 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 10:14:43 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi William No don't. The article is about the _server_ side! /gustav >>> wdhindman at dejpolsystems.com 01-05-2008 09:24 >>> ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav From jwcolby at colbyconsulting.com Thu May 1 06:10:13 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 07:10:13 -0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <034201c8ab62$25a2cc70$6401a8c0@nant> References: <034201c8ab62$25a2cc70$6401a8c0@nant> Message-ID: <4819A515.9080300@colbyconsulting.com> Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 Thu May 1 06:27:39 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 15:27:39 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <4819A515.9080300@colbyconsulting.com> Message-ID: <036d01c8ab7e$5d8845e0$6401a8c0@nant> John, May I argue that Borge just needs to get VB6 code reused (copied and pasted) in his VBA project? Let's ask Borge? Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 3:10 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 pcs.accessd at gmail.com Thu May 1 07:08:11 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 22:08:11 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <036d01c8ab7e$5d8845e0$6401a8c0@nant> References: <4819A515.9080300@colbyconsulting.com> <036d01c8ab7e$5d8845e0$6401a8c0@nant> Message-ID: Hi guys, I was going to just say please disregard my post... But this is what happened: I have this HTTPClass.cls from http://www.paradoxes.info/code/HTTPClass.html We are using it to send data across the internet to a service provider who does Text To Speech (TTS) for us, then sends out phone calls, receives the keys press feed back from the clients - which in turn is sent back to us via another process ... used for identifying short term relief staff to fill short term vacancies in different industries .... So far I had been using the properties from a .dll created on the class and referenced into the VBA project. Questions came up about the format of the parameters we are sending across, so I had to start look into this thing and pick out the string that is actually being sent. So I thought I try and import the .cls into a class module and run the class in the VBA project so I can debug.print the POSTDATA string of the SendRequest function... (see the code on the website...) To answer your question: I did Insert > ClassModule > Pasted the Code from HTTPSClass.cls > Compiled Code > Saved the Class Module No problems! What prompted my question was that I had opened the .cls file in VisualStudio and it had added the Version and Attribute lines I was having problem with - which turns out is not part of the original .cls file and is totally unnecessary .. John and Shamil, thanks for responding... regards borge On Thu, May 1, 2008 at 9:27 PM, Shamil Salakhetdinov < shamil at smsconsulting.spb.ru> wrote: > John, > > May I argue that Borge just needs to get VB6 code reused (copied and > pasted) > in his VBA project? Let's ask Borge? > > Thanks. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 3:10 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Shamil, > > If you notice the Exposed and creatable properties, it appears that he > is trying to make the class viewable from outside of a library. Just > deleting those lines will prevent that. > > He needs to do the Insert Class, Insert file thing. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: > > Hi Borge, > > > > Just remove these lines, which do not compile - those are attributes > used > > internally by VB6: VBA has some similar attributes but you usually do > not > > need to change them from within VBA's IDE.... > > > > -- > > Shamil > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > > Sent: Thursday, May 01, 2008 11:33 AM > > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > > > Hi there, > > > > I am swimming in the deep end of the pool and threading water so to > speak > > .... I need help! > > > > I have imported a VB6 .cls file into VBA > > > > The following shows up in red and will not compile > > > > 'Will not compile : > > VERSION 1.0 CLASS > > > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > 'End of lines not compiling > > > > Here is the beginning of the module - it's the HTTPClass.cls from > available > > from some VB6 website, can't remember the link right now ...; > > all other code lines appear ok in VBA > > > > What do I need to do?? > > > > > > > > '**** Beginning of VBA Class Module :: > > Option Compare Database > > Option Explicit > > VERSION 1.0 CLASS > > BEGIN > > MultiUse = -1 'True > > Persistable = 0 'NotPersistable > > DataBindingBehavior = 0 'vbNone > > DataSourceBehavior = 0 'vbNone > > MTSTransactionMode = 0 'NotAnMTSObject > > End > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > > > Public Enum ePort > > INTERNET_DEFAULT_HTTP_PORT = 80 > > INTERNET_DEFAULT_HTTPS_PORT = 443 > > End Enum > > ... > > > > > > Regards > > borge > > _______________________________________________ > > 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 Thu May 1 07:10:05 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:10:05 -0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> References: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> Message-ID: <4819B31D.2060706@colbyconsulting.com> I have many indexes set up which include the PKID and one or more other fields. One would think that the optimizer would use one of those indexes instead of the clustered PKID index. I am thinking that a hint is in order to force SQL Server to use a different index. That is beyond my expertise however. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > <<< > No matter how you slice it, it has to process > more physical disk sectors etc. > Hi John, > > Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' > fields but it would be enough to scan index entries, and even maybe non-leaf > index pages' entries for the query returning every 1000th row - then the > difference I thought between the time to get results from 1+ million rows > data table and 90 millions wouldn't be that significant. It's obvious now > that that was my wrong assumption because clustered index has actual data > rows on its leaf-nodes: > > Clustered Index > http://msdn.microsoft.com/en-us/library/ms177443.aspx > > Non-Clustered Index > http://msdn.microsoft.com/en-us/library/ms177484.aspx > > > New hypothesis based on info on clustered and non-clustered index structure: > With *Non-clustered* index defined for your PKID the following query > performance should be significantly better. Although I'd not guess now how > much time it could take to get this query finished with your db: > > SELECT RowNum, PKID from ( select > Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID > from [Names]) s > where (s.RowNum % 1000) = 1 > union all > Select NULL as RowNum, Max(PKID) as PKID from [Names] > > When there exists a non-clustered index together with clustered for the same > field and this field is used in a query as 'order by' or as selection > criteria then MS SQL uses non-clustered index as far as I see from query > execution plan... > > Here is how I did create non-clustered index to the test table called > [dbo].[Names]: > > if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') > DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > GO > > CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > SORT_IN_TEMPDB = OFF, > IGNORE_DUP_KEY = OFF, > DROP_EXISTING = OFF, > ONLINE = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) > ON [PRIMARY] > GO > > (BTW, did you ever try to create non-clustered indexes on non-PRIMARY > filegroups of an MS SQL 2000/2005 database? - another tip, which could > improve query performance, especially if to keep indexes' filegroups on > different HDDs - and the latter could be not backed-up because indexes can > be rebuilt anytime, and building non-clustered indexes should be non that > time consuming even for 90 million records DB? ) > > Please feel free to check or ignore the new hypothesis with your 90 million > db table... > > Thank you. > > -- > Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 1:16 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] vb.net - Updates > > I do have the clustered stuff exactly as you show: > > > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > > ( > > [PKID] ASC > > ) > > WITH (PAD_INDEX = OFF, > > STATISTICS_NORECOMPUTE = OFF, > > IGNORE_DUP_KEY = OFF, > > ALLOW_ROW_LOCKS = ON, > > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > > ) ON [PRIMARY] > > Likewise I am getting the same 99% cost clustered index scan. > > I have to guess it is something else. There is a lot of empty space in > the database file which I will compact out tonight. It takes hours > because of the size and when it is doing that I cannot use the db. > Perhaps I have severe fragmentation or something. The database size is > 300 GIGS. And finally just remember that when all is said and done it > is still a hundred times larger than your database. No matter how you > slice it, it has to process more physical disk sectors etc. > > 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 jwcolby at colbyconsulting.com Thu May 1 07:37:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:37:44 -0400 Subject: [dba-VB] System not responding for seconds at a time Message-ID: <4819B998.40507@colbyconsulting.com> I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Thu May 1 08:28:46 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 01 May 2008 06:28:46 -0700 Subject: [dba-VB] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> Message-ID: <0K0600GA3YRY8146@vms173001.mailsrvcs.net> John, Try Process Explorer from SysInternals. It shows everything that's running on your machine. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx And yes SQL server does in fact take up a lot of memory when shrinking files. I would stop the sql server and the sql server agent using Services in Control Panel->Admin Tools but make sure it is not writing to the disk first. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 5:38 AM To: Discussion of Hardware and Software issues; VBA; Dba-Sqlserver Subject: [dba-VB] System not responding for seconds at a time I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- 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 jwcolby at colbyconsulting.com Thu May 1 08:30:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 09:30:44 -0400 Subject: [dba-VB] [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> Message-ID: <4819C604.4000901@colbyconsulting.com> Well... it appears that I have fixed the issue. After Googling "slow server response time" or something similar I ran across references to a "Maximum Memory" property for SQL Server. I finally found that and it was set to something insane like 200000000 MEGABYTES (several petabytes of server memory). While I can dream of such a machine, it ain't happening here! I adjusted the Maximum Memory down to 2 gigs and the "amount available" in Task Manager Performance tab popped up to 4 gigs. Having done that, and after perhaps 30 seconds, suddenly my machine is responding in a normal way. I am now adjusting that number to "leave" perhaps 2 gigs available to applications other than SQL Server. I probably don't even need 2 gigs but it is critical that I don't end up unable to do anything on that machine. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I don't quite know where to address this so I am cross posting it. I am > working on a fairly powerful server running Windows 2003 x64 and SQL > Server 2003 x64. It has 8 gigs of memory. No malware software, > software firewall, virus scanner etc. Nothing. > > I am running a file shrink on the SQL Server file, trying to remove > about 140 gigs of empty space. That process has been running since last > night, well over 8 hours now. It APPEARS that process is using all of > available memory since task manager shows only about 200 megs > "available". However if you look at the process tab, no process says it > is using more than 100 megs of ram. The performance tab shows almost no > CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then > only one of the cores appears to be doing anything. > > The computer is "stuttering" badly. Try to do anything - change to a > different program, page up in visual studios code etc, and the computer > will usually hesitate before doing whatever you requested. I am trying > to work on a VB project and can't get anything done because as I move > around in the doc it may take 2 to 5 seconds just to respond to my > request to move my cursor. > > Has anyone seen SQL Server lock up the the system like this, IOW is it > SQL Server? Does anyone know how long the file shrink could take - > days, weeks, months? Does anyone know how to cancel the file shrink? > This is the most powerful server I have, quad core, running x64 > software, 8 gigs, high speed raid arrays etc. > > Unfortunately I was in the middle of a vb.net project yesterday before I > started the shrink running after work and the server is unusable for > anything right now. > From accessd at shaw.ca Thu May 1 18:27:16 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 16:27:16 -0700 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux In-Reply-To: References: Message-ID: <803E0A4449764EF0AE3F013A4B9443AF@creativesystemdesigns.com> That is stellar news Gustav. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, April 30, 2008 11:29 PM To: The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav _______________________________________________ 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 May 2 06:00:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:00:19 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... Message-ID: <044901c8ac43$b6314e10$6401a8c0@nant> Hi All, Anybody lucky here to manage to find where to download "Classifieds Web Site Starter Kit"? The link on its web site hosted by MS http://www.asp.net/downloads/starter-kits/classifieds/ seems to be brokwen as well as on some other sites, which all refer this broken link. Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 06:08:42 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 07:08:42 -0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... References: <044901c8ac43$b6314e10$6401a8c0@nant> Message-ID: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 06:38:20 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:38:20 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... In-Reply-To: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Message-ID: <045001c8ac49$083bb560$6401a8c0@nant> Thank you, Michael! Yes, discountasp.net has a link, which leads to correct "Classifieds Web Site Starter Kit Download": http://download.microsoft.com/download/e/d/d/edd838dc-d369-403f-a5e0-d1ca2b5 be0be/class.vsi -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys Sent: Friday, May 02, 2008 3:09 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Classifieds Web Site Starter Kit Download... Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 08:53:11 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 17:53:11 +0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial on CodeProject Message-ID: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Hi All, I have found the following article as a good source on WinForms databinding with custom classes: A Detailed WinForns Data Binding Tutorial http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx Was it mentioned here already? Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 10:31:28 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 11:31:28 -0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject References: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Message-ID: <00ce01c8ac69$9825b250$0502a8c0@Laptop> Hi Shamil, No, I hadn't seen this before. Thank you! Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 9:53 AM Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject > Hi All, > > I have found the following article as a good source on WinForms > databinding > with custom classes: > > A Detailed WinForns Data Binding Tutorial > > http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx > > Was it mentioned here already? > > Thank you. > > -- > Shamil > > _______________________________________________ > 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 May 2 12:35:52 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:35:52 -0400 Subject: [dba-VB] Visual Studio 2008 Message-ID: <481B50F8.5020202@colbyconsulting.com> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 2 12:43:58 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 02 May 2008 19:43:58 +0200 Subject: [dba-VB] Visual Studio 2008 Message-ID: Hi John I have both installed. Only task on Vista was to download and install a large update for VS2005 which it announces when the initial install has finished. /gustav >>> jwcolby at colbyconsulting.com 02-05-2008 19:35 >>> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri May 2 12:47:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:47:26 -0400 Subject: [dba-VB] Visual Studio 2008 In-Reply-To: <481B50F8.5020202@colbyconsulting.com> References: <481B50F8.5020202@colbyconsulting.com> Message-ID: <481B53AE.4080802@colbyconsulting.com> Other than learn how to spell? ;-) John W. Colby www.ColbyConsulting.com jwcolby wrote: > Can VS2008 co-habitate with 2005? Andything special I need to do? > From Gustav at cactus.dk Sun May 4 02:23:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 09:23:53 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi all What do you use as feed for the Start Page? If any? I noticed that neither in VS2005 nor VS2008 the Start Page has been updated since the initial install. In VS2008 this URL is created: http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 It links to: http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml which has a last entry of Mar. 20th. That explains. But why does VS install this? I located via Google another feed: http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml which seems to update. But that is not C#. /gustav From wdhindman at dejpolsystems.com Sun May 4 02:45:49 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 4 May 2008 03:45:49 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <4E8801746B1B499B88AD78BD3B3E542F@jislaptopdev> ...nice find Gustav ...I'd just eliminated the start page altogether ...I'll have to give this a shot :) William -------------------------------------------------- From: "Gustav Brock" Sent: Sunday, May 04, 2008 3:23 AM To: " Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From mmattys at rochester.rr.com Sun May 4 06:53:16 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 07:53:16 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <002501c8addd$71922540$0502a8c0@Laptop> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /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 Sun May 4 07:01:35 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 04 May 2008 08:01:35 -0400 Subject: [dba-VB] SQL Server timeouts Message-ID: <481DA59F.5060503@colbyconsulting.com> I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Sun May 4 07:46:05 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 08:46:05 -0400 Subject: [dba-VB] SQL Server timeouts References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <005401c8ade4$d20375d0$0502a8c0@Laptop> While I was on Amazon a few days ago, the key word "Tuning" caught my eye - - so I looked it up. This might help, but do Google: http://www.codeproject.com/KB/database/sql-tuning-tutorial-1.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: "VBA" ; "Dba-Sqlserver" Sent: Sunday, May 04, 2008 8:01 AM Subject: [dba-VB] SQL Server timeouts >I am running this process that updates SQL Server from VB.Net. The > process runs normally for tens of millions of records, then SQL Server > "hangs" and stops servicing requests (from this process), either reads > or writes. It just times out with error messages "Timeout Expired: The > timeout period expired prior to completion of the operation or SQL > Server is not responding". > > This is not a once off occurrence, it happens every time I start the > process running. Sometimes I get this and then eventually SQL Server > will start responding, sometimes it just stops responding. > > How do I troubleshoot this? > -- > 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 mikedorism at verizon.net Sun May 4 08:07:01 2008 From: mikedorism at verizon.net (Doris Manning) Date: Sun, 04 May 2008 09:07:01 -0400 Subject: [dba-VB] SQL Server timeouts In-Reply-To: <481DA59F.5060503@colbyconsulting.com> References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <000901c8ade7$be7d6a40$2d01a8c0@Kermit> The culprit is probably a system database called "tempdb". This database gets reset each time you stop and restart SQL Server. In my world, I had to create a job to shrink it every hour in order to resolve this issue. http://sqlserver2000.databases.aspfaq.com/why-is-tempdb-full-and-how-can-i-p revent-this-from-happening.html Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, May 04, 2008 8:02 AM To: VBA; Dba-Sqlserver Subject: [dba-VB] SQL Server timeouts I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- 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 Gustav at cactus.dk Sun May 4 08:39:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 15:39:07 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi Michael Some typos here? Should be, I guess: http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 Links to: http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml /gustav >>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav From mmattys at rochester.rr.com Sun May 4 09:30:11 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 10:30:11 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <006801c8adf3$5cf9c4b0$0502a8c0@Laptop> Sorry, working from two laptops ... one connected, one protected. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: Sent: Sunday, May 04, 2008 9:39 AM Subject: Re: [dba-VB] VS Start Page feed > Hi Michael > > Some typos here? Should be, I guess: > http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 > > Links to: > http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml > > /gustav > >>>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> > Mine says: > > (Last update Fri., May 2) > http://go.microsoft.com/flink/?linkid45191&clcid=409 > > Michael R. Mattys > MapPoint & Access Dev > www.mattysconsulting.com > > ----- Original Message ----- > From: "Gustav Brock" > To: " > Sent: Sunday, May 04, 2008 3:23 AM > Subject: [dba-VB] VS Start Page feed > > >> Hi all >> >> What do you use as feed for the Start Page? If any? >> >> I noticed that neither in VS2005 nor VS2008 the Start Page has been >> updated since the initial install. >> In VS2008 this URL is created: >> >> http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 >> >> It links to: >> >> http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml >> >> which has a last entry of Mar. 20th. >> That explains. But why does VS install this? >> >> I located via Google another feed: >> >> http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml >> >> which seems to update. But that is not C#. >> >> /gustav > > > > _______________________________________________ > 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 May 5 08:03:23 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 17:03:23 +0400 Subject: [dba-VB] FYI: Programming ftp in .NET Message-ID: <05ed01c8aeb0$68210250$6401a8c0@nant> Hi All, It happens that basic FTP access - login, change dir, upload and download can be relatively easy programmed by using this free code - http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm ... I have found just one issue: while uploading a file having left or right curly bracket - '{' or '}' in ASCII mode I'm getting "Input line wasn't in correct format" runtime error on this code line: public class FTPClient ... private void PutASCII(Stream srcStream, string remoteFile, bool append) ... writer.Write(line, 0, line.Length); ... When I make curly bracket duplicated then it works well, but then download doesn't work again breaking on curly bracket... Have you seen issues like that? (I guess I have here FTP protocol specs violation in the case of curly brackets?) In BINARY mode everything seems to work well, therefore issue isn't that critical still I'd be interested to know what other chars could result in runtime errors? And how to properly escape curly brackets to implement FTP put and get in ASCII mode.... BTW, in P.S. you can find simple C# Windows Console app FTP test of the referred above free source Thanks. -- Shamil P.S. using System; using System.Collections.Generic; using System.Text; using com.enterprisedt.net.ftp; using FTP; namespace FTPTestConsole { class Program { private static void logger_OnLoggableEvent(object o, LogInfoEventArgs e) { //lbProgress.Items.Add(e.Message); //lbProgress.SelectedIndex = lbProgress.Items.Count - 1; //Application.DoEvents(); Console.WriteLine(e.Message); } private static string _host = "{{yourHostHere}}"; private static string _userId = "{{yourUserNameHere}}"; private static string _password = "{{yourPasswordHere}}"; private static string _ftpFolder = "testUp"; private static string _localUploadedFileFullPath = @"E:\temp\up.txt"; private static string _localDownloadedFileFullPath = @"E:\temp\OK.txt"; private static string _remoteFileName = "test.txt"; static void Main(string[] args) { try { // Create and register a logger FTP.Logger logger = new FTP.Logger(); //logger.OnLoggableEvent += new FTP.Logger.LoggableEventHandler(logger_OnLoggableEvent); logger.OnLoggableEvent += new Logger.LoggableEventHandler(logger_OnLoggableEvent); // create an instance of FTPClient, passing in the name of hte host, the time out // and the logger for updates string host = _host; com.enterprisedt.net.ftp.FTPClient ftpClient = new com.enterprisedt.net.ftp.FTPClient(host); // call login, passing in the user id and the password string user = _userId; string pw = _password; ftpClient.Login(user, pw); // change directory on the host logger.Write(null, "Client requesting change directory to " + _ftpFolder); string newDirectory = _ftpFolder; ftpClient.Chdir(newDirectory); // send a file to the host (rename it there) logger.Write(null, "Client calling Put(" + _localUploadedFileFullPath + "," + _remoteFileName + ")"); string localFileName = _localUploadedFileFullPath; string remoteFileName = _remoteFileName; //ftpClient.Put(localFileName, remoteFileName); ftpClient.TransferType = FTPTransferType.BINARY; ftpClient.Put(localFileName, remoteFileName); // ge the file back from the host, rename it here logger.Write(null, "Client calling Get(" + _localDownloadedFileFullPath + "," + _remoteFileName + ")"); string newFileName = _localDownloadedFileFullPath; ftpClient.Get(newFileName, remoteFileName); // clean up and go home logger.Write(null, "Client calling quit"); ftpClient.Quit(); logger.Write(null, "Done."); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } } From jwcolby at colbyconsulting.com Mon May 5 08:06:01 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 09:06:01 -0400 Subject: [dba-VB] SQL Server WHERE Clause order Message-ID: <481F0639.2090300@colbyconsulting.com> Does it make any difference in SQL Server the order of the WHERE clause items. For example: WHERE (LastName IS NOT NULL) AND (AGE > 30) vs WHERE (AGE > 30) AND (LastName IS NOT NULL) -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:23:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:23:26 -0400 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: <481F266E.9020104@colbyconsulting.com> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:41:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:41:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F2AAB.7060109@colbyconsulting.com> When I type ?string.format("yyyyMMdd",Date.Today) into the debug window I get yyyyMMdd (the literal string) not 20080505. What am I doing wrong? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 10:43:08 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 19:43:08 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> Message-ID: <061d01c8aec6$b73dafd0$6401a8c0@nant> Hi John, This should be it: Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) Console.WriteLine(dt) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:23 PM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 mikedorism at verizon.net Mon May 5 10:46:24 2008 From: mikedorism at verizon.net (Doris Manning) Date: Mon, 05 May 2008 11:46:24 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <000601c8aec7$2cc87a00$2d01a8c0@Kermit> JC, Try using... Format(Date.Now, "yyyyMMdd-hhmmss") Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 11:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Gustav at cactus.dk Mon May 5 10:51:41 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 05 May 2008 17:51:41 +0200 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: Hi John Here's a good reference on date format strings with lots of samples: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx /gustav >>> jwcolby at colbyconsulting.com 05-05-2008 17:23 >>> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:59:03 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:59:03 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <061d01c8aec6$b73dafd0$6401a8c0@nant> References: <061d01c8aec6$b73dafd0$6401a8c0@nant> Message-ID: <481F2EC7.8020700@colbyconsulting.com> Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 11:17:13 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 20:17:13 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <062401c8aecb$7a495700$6401a8c0@nant> OK - DateTime.Now.ToString("yyyyMMdd-hhmmss") should work well also. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Mon May 5 11:40:43 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 5 May 2008 09:40:43 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <003801c8aece$c32188f0$0200a8c0@murphy3234aaf1> Hi John, I have an app that does something similar with wav files. What I use to time stamp the files is to use the time as the file name as follows. sFileName = sFolder & CStr(DatePart("h", Now)) & "_" & CStr(DatePart("n", Now)) & "_" & CStr(DatePart("s", Now)) & ".wav" May not be elegant but it works. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Mon May 5 11:46:42 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 5 May 2008 09:46:42 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: I would strongly suggest you use an underscore rather than a hyphen in your file name. We've encountered various situations where the hyphen is treated as an invalid character, particularly when transferring files electronically. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com _______________________________________________ From jwcolby at colbyconsulting.com Mon May 5 12:07:37 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 13:07:37 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F3ED9.9020100@colbyconsulting.com> I can do that. Thanks. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > I would strongly suggest you use an underscore rather than a hyphen in > your file name. We've encountered various situations where the hyphen > is treated as an invalid character, particularly when transferring files > electronically. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 8:23 AM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > > -- > 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 jwcolby at colbyconsulting.com Tue May 6 15:50:18 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 May 2008 16:50:18 -0400 Subject: [dba-VB] SP1 - how do you tell Message-ID: <4820C48A.4060406@colbyconsulting.com> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue May 6 16:00:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 May 2008 23:00:07 +0200 Subject: [dba-VB] SP1 - how do you tell Message-ID: Hi John Mine tells: Version 8.0.50727.867 (vvista.050727-8600) /gustav >>> jwcolby at colbyconsulting.com 06-05-2008 22:50 >>> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed May 7 06:53:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 May 2008 15:53:15 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <07c101c8b038$ef88b470$6401a8c0@nant> Hi John, Please make correction to your string formatting: Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) Console.WriteLine(dt) IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the hour value in 00 - 11 range, and you might get file names collisions: yes, very low probability to get such collisions but "Murphy Laws" are waiting us, developers, around every corner, you know, and we have to be very accurate, and a little bit "paranoid"... Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ 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 May 7 07:05:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 07 May 2008 08:05:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <07c101c8b038$ef88b470$6401a8c0@nant> References: <07c101c8b038$ef88b470$6401a8c0@nant> Message-ID: <48219B0B.7040901@colbyconsulting.com> Thanks for that Shamil. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Please make correction to your string formatting: > > Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) > Console.WriteLine(dt) > > IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the > hour value in 00 - 11 range, and you might get file names collisions: yes, > very low probability to get such collisions but "Murphy Laws" are waiting > us, developers, around every corner, you know, and we have to be very > accurate, and a little bit "paranoid"... > > Thanks. > > -- > Shamil From max.wanadoo at gmail.com Thu May 8 02:42:37 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 8 May 2008 08:42:37 +0100 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <05ed01c8aeb0$68210250$6401a8c0@nant> References: <05ed01c8aeb0$68210250$6401a8c0@nant> Message-ID: <000301c8b0df$16739bd0$8119fea9@LTVM> Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max From fhtapia at gmail.com Thu May 8 08:08:28 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 06:08:28 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: I am in the middle of testing it, I will post back when I have completed my tests On 5/8/08, Max Wanadoo wrote: > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From dwaters at usinternet.com Thu May 8 08:12:07 2008 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 8 May 2008 08:12:07 -0500 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: <001301c8b10d$1e4579e0$0300a8c0@danwaters> When I tried to install it by the normal method, I got an 'Access Denied' error during installation. It did gracefully uninstall all the SP3 files and I'm back to where I was no worse for the wear. I downloaded the update (about 30 minutes w/DSL) and I'll try next with that. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Thursday, May 08, 2008 2:43 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] XP Service Pack 3 and Access Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max _______________________________________________ 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 Thu May 8 11:29:49 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 08 May 2008 18:29:49 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From jwcolby at colbyconsulting.com Thu May 8 13:05:06 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 08 May 2008 14:05:06 -0400 Subject: [dba-VB] Dual boot Server 2003 X32 and x64 Message-ID: <482340D2.5090608@colbyconsulting.com> Does anyone know if it is possible to dual boot the x32 and x64 version of windows 2k3? My concern in doing so is that on the one server that I run 2k3 x64 on, there are two program file directories, one called Program Files the other called Program Files (x86). It APPEARS that the (x86) directory is the 32 bit directory which would imply that the one without was the x64, though I have nothing more to base that on than the names of the directories inside of each Program Files directory. I just got a 2nd Phenom quad core and want to convert a second system to quad core x64. The EASIEST way would be to dual boot until I have everything I need running in x64 and then cut over. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu May 8 13:47:26 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 11:47:26 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <001301c8b10d$1e4579e0$0300a8c0@danwaters> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> <001301c8b10d$1e4579e0$0300a8c0@danwaters> Message-ID: I downloaded the file straight from the download center and did a normal install On Thu, May 8, 2008 at 6:12 AM, Dan Waters wrote: > When I tried to install it by the normal method, I got an 'Access Denied' > error during installation. It did gracefully uninstall all the SP3 files > and I'm back to where I was no worse for the wear. > > I downloaded the update (about 30 minutes w/DSL) and I'll try next with > that. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo > Sent: Thursday, May 08, 2008 2:43 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: [dba-VB] XP Service Pack 3 and Access > > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From mikedorism at verizon.net Thu May 8 16:43:29 2008 From: mikedorism at verizon.net (Doris Manning) Date: Thu, 08 May 2008 17:43:29 -0400 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: <001801c8b154$8e4561a0$2d01a8c0@Kermit> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Thu May 8 17:14:14 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 00:14:14 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Thu May 8 17:47:10 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 8 May 2008 15:47:10 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 May 9 03:50:12 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 10:50:12 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /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 Gustav at cactus.dk Fri May 9 05:36:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 12:36:19 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From Gustav at cactus.dk Fri May 9 06:22:33 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 13:22:33 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Here's a simple dirty trick to force a validate of a CheckBox: Hide the checkbox, Show it again and set Focus. As the control looses focus, Validating and Validated will fire. The previous control will get focus. You show the control again and move focus back (and the Validating and Validated events of the previous control will fire). It happens so fast that nothing strange is to be seen for the user. private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.checkBoxRegistered.Hide(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Show(); this.checkBoxRegistered.Focus(); // Focus has been retained. // Validating and Validated of the previous control will fire. } Another option is to have a tiny dummy control containing no event code where focus temporarily can be stoved away: private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.noop.Focus(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Focus(); // Focus has been regained. // Validating and Validated of the dummy control will fire. } /gustav >>> Gustav at cactus.dk 09-05-2008 10:50 >>> Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Fri May 9 10:45:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 9 May 2008 08:45:06 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.as px The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Mon May 12 14:50:05 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 12 May 2008 21:50:05 +0200 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... Message-ID: Hi all Anyone encountered this nasty bug? It seems to have lived for years(!): http://forums.microsoft.com/msdn/showpost.aspx?postid=277680&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=10 I have a Winform with a DataGridView and some bound textboxes. Data source is a DataTable. Update goes like this: this.Validate(true); this.mediaBindingSource.EndEdit(); this.mediaTableAdapter.Update(this.MyAdapter.Media); Sometimes after multiple but not stressed updates, the exception error is raised. Any ideas or workarounds? /gustav From mikedorism at verizon.net Tue May 13 06:15:30 2008 From: mikedorism at verizon.net (Doris Manning) Date: Tue, 13 May 2008 07:15:30 -0400 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... In-Reply-To: References: Message-ID: <000001c8b4ea$a88b7d80$2d01a8c0@Kermit> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Doris It doesn't. However, I think I tracked down the issue after much trial and error. It happens if you perform multiple updates of the same row when an update is called immediately following each value change of several controls via the GUI. By only performing one update for each row, the issue seems to stay dormant. /gustav >>> mikedorism at verizon.net 13-05-2008 13:15 >>> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Charlotte and Doris I've found that if you bind a DataTable to a non-tristate CheckBox and try to insert a new row having set Checked to either True or False but without specifying the CheckState property, the insert will fail because CheckState will pass a DBNull to the DataTable. Thus, you must bind the CheckState property to the DataTable and - for a new record - set CheckState to either Checked or Unchecked. /gustav >>> cfoust at infostatsystems.com 09-05-2008 17:45 >>> We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From shamil at smsconsulting.spb.ru Tue May 20 12:29:50 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 21:29:50 +0400 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN In-Reply-To: <4812075D.6000306@colbyconsulting.com> Message-ID: <11cb01c8ba9f$1c873ad0$6401a8c0@nant> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- 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 shamil at smsconsulting.spb.ru Tue May 20 14:16:41 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 23:16:41 +0400 Subject: [dba-VB] Fail Fast Message-ID: <11e301c8baae$08c911d0$6401a8c0@nant> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From cfoust at infostatsystems.com Tue May 20 14:32:37 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 May 2008 12:32:37 -0700 Subject: [dba-VB] Fail Fast In-Reply-To: <11e301c8baae$08c911d0$6401a8c0@nant> References: <11e301c8baae$08c911d0$6401a8c0@nant> Message-ID: Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 Wed May 21 16:48:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 22 May 2008 01:48:22 +0400 Subject: [dba-VB] Fail Fast In-Reply-To: Message-ID: <137801c8bb8c$649cc3b0$6401a8c0@nant> Hi Charlotte, Thank you for sharing your experience on the subject. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, May 20, 2008 11:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Fail Fast Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 paul.hartland at googlemail.com Fri May 23 06:25:46 2008 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 23 May 2008 12:25:46 +0100 Subject: [dba-VB] Using MapPoint To Get Driving Distance Message-ID: <38c884770805230425k514699dcq1fadc18ee59e7184@mail.gmail.com> To all, I am trying to get driving distance from MapPoint 2006 using Visual Basic 6.0, which I have done. The problem being that it takes roughly two seconds to retrieve the distance. Has anyone had any experience of doing something similar and could possibly point me in the right direction of finding a faster way. Two seconds doesn't sound like a long time, but when we want to schedule about 30 people on a job, this adds around a minute to get the distance's from the employees postcode to the client's postcode. Also I am having trouble with some postcodes especially BT8 (Ireland), if you type BT8 it will not find the location, however if you put the address in it finds it and shows the postcode as BT8, where in Google maps it will find BT8 without a problem. Thank you in advance for any help on this matter..... -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri May 23 13:00:22 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:00:22 +0200 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN Message-ID: Hi Shamil Thanks for that link. As I read it, Bazaar could be the choice: http://bazaar-vcs.org However, not a single word of integration with Visual Studio except for a "dead" plug-in for VS2005 ... To me, that settles it. No Bazaar for me. Anyone with some experience of Bazaar? /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 19:29 >>> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 23 13:35:37 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:35:37 +0200 Subject: [dba-VB] Fail Fast Message-ID: Hi Shamil I like that approach, actually I once had the idea that error messages should be localized ... The article mentions an example of the type: On Error .. let value of variable x = 10 That is plain bad code in my opinion and makes a discussion on what approach to use difficult. However, when I think about it - encouraged by your posting - in Access I don't use error handling that much and mostly on a general level to catch disk/network errors and the like. I run so many tests on various user inputs during development that the code is virtually bug free. Well, of course not, but the level is so low that it doesn't pay off to do more about it. In most installations of our software we see zero errors a year caused by the software itself. Errors met are caused by network or hardware malfunction. With Visual Studio it is different but similar. I've found that when an error is raised, the message is so informative that I don't need more information. Also the stack window is a great help and - again - the IDE of VS demonstrated its superiority at a surprising level when I noticed the first time that code lines with jumps to other code modules are highlighted. Of course I include a try/catch here and there but I prefer to check for potential errors - like a lost connection before running a major update routine. Further, to my surprise, VS lets some errors pass which don't have to stop the code, indeed formatting errors for empty strings. This is certainly an indication of a value not intended, so I turned on the setting that will raise an error in such cases. Put a check mark in Thrown here: Debug, Exceptions ..., Common Language Runtime Exceptions, System, System.FormatException /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 21:16 >>> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri May 23 18:03:51 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 May 2008 19:03:51 -0400 Subject: [dba-VB] CDO Email Message-ID: <48374D57.2060502@colbyconsulting.com> Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Sat May 24 11:05:54 2008 From: ebarro at verizon.net (Eric Barro) Date: Sat, 24 May 2008 09:05:54 -0700 Subject: [dba-VB] CDO Email In-Reply-To: <48374D57.2060502@colbyconsulting.com> References: <48374D57.2060502@colbyconsulting.com> Message-ID: <001f01c8bdb8$0f922fd0$1003000a@advancedinput.com> When you send via your forwarding SMTP server using Thunderbird are you sending (via the email client) authentication? I have to assume that most SMTP servers today expect both username and password to authenticate before they even allow you to send mail out via the SMTP service. There's a setting for authentication that you need to send. mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti cate", 1); ' set to authenticate mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername ", uxSMTPUser.Text); 'send the smtp username mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword ", uxSMTPPassword.Text); 'send the smtp password You can adapt that .NET code for your use. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, May 23, 2008 4:04 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] CDO Email Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- 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 jwcolby at colbyconsulting.com Thu May 29 11:19:47 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 12:19:47 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTE classification-tree editor In-Reply-To: References: Message-ID: <483ED7A3.1070206@colbyconsulting.com> I had a very interesting conversation with my tax guy this morning. He had previously worked at Lowes Hardware in their accounting department. The upshot of the conversation was that Lowes has to interface to a huge number of legacy systems, systems from suppliers, banks, systems from companies they purchased 10 years ago and inherited etc. His comment of interest is that in many cases they did not do testing. Or more correctly they threw data at the live system and looked at what happened, and then used a feedback loop to work around to what the system at the other end would accept. Sounds like poor Roz at her current assignment. I have to tell you that I have experienced this same thing. My disability insurance call center software has to interface to about 10 (so far) completely different insurance companies. Each company has dozens of legacy systems. We get "specs" for how to receive and transmit data to these mainframe systems. I write code to meet the spec, then we send data. We then get feedback from them about how to change the program to meet the "REAL spec" which is never the printed spec. Iterate until the feedback stops and they start accepting what we send without complaint. In one case they had specified how to output claim data that they wanted to enter into their system. In this one (admittedly extreme) case it was in a vertical report format, which we did. Some six months later we discovered that the format was designed to allow some key entry person to key it into their system manually, and the "report order" was the order that the data entry fields appeared on her screen. I got a chuckle out of that one. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > A local computer paper brought attention to this work related to Daimler-Chrysler but useful in many areas: > > http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 > > > This page contains papers on the classification-tree method CTM and the classification-tree editor CTE. The classification-tree method is a testing method for the systematic design of test cases on basis of the specification. The classification-tree editor is a graphical editor supporting the application of the classification-tree method. CTM and CTE are widely used in industrial practice. > > > The CTE software is free to download and use and the page contains links to a bunch of documentation. > Here's an intro: > > http://www.systematic-testing.com/documents/eurostar2000.pdf > > > > > From wdhindman at dejpolsystems.com Thu May 29 15:04:31 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 29 May 2008 16:04:31 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: ...I thought that's how everyone does it :) William "The truth is incontrovertible, malice may attack it, ignorance may deride it, but in the end; there it is." -------------------------------------------------- From: "jwcolby" Sent: Thursday, May 29, 2008 12:19 PM To: "Access Developers discussion and problem solving" ; "VBA" ; "Discussion of Hardware and Software issues" Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor > I had a very interesting conversation with my tax guy this > morning. He had previously worked at Lowes Hardware in > their accounting department. > > The upshot of the conversation was that Lowes has to > interface to a huge number of legacy systems, systems from > suppliers, banks, systems from companies they purchased 10 > years ago and inherited etc. His comment of interest is > that in many cases they did not do testing. Or more > correctly they threw data at the live system and looked at > what happened, and then used a feedback loop to work around > to what the system at the other end would accept. > > Sounds like poor Roz at her current assignment. > > I have to tell you that I have experienced this same thing. > My disability insurance call center software has to > interface to about 10 (so far) completely different > insurance companies. Each company has dozens of legacy > systems. > > We get "specs" for how to receive and transmit data to these > mainframe systems. I write code to meet the spec, then we > send data. We then get feedback from them about how to > change the program to meet the "REAL spec" which is never > the printed spec. Iterate until the feedback stops and they > start accepting what we send without complaint. > > In one case they had specified how to output claim data that > they wanted to enter into their system. In this one > (admittedly extreme) case it was in a vertical report > format, which we did. Some six months later we discovered > that the format was designed to allow some key entry person > to key it into their system manually, and the "report order" > was the order that the data entry fields appeared on her screen. > > I got a chuckle out of that one. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi all >> >> A local computer paper brought attention to this work related to >> Daimler-Chrysler but useful in many areas: >> >> http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 >> >> >> This page contains papers on the classification-tree method CTM and the >> classification-tree editor CTE. The classification-tree method is a >> testing method for the systematic design of test cases on basis of the >> specification. The classification-tree editor is a graphical editor >> supporting the application of the classification-tree method. CTM and CTE >> are widely used in industrial practice. >> >> >> The CTE software is free to download and use and the page contains links >> to a bunch of documentation. >> Here's an intro: >> >> http://www.systematic-testing.com/documents/eurostar2000.pdf >> >> >> >> >> > _______________________________________________ > 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 Thu May 29 15:09:34 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 16:09:34 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor In-Reply-To: References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: <483F0D7E.6090905@colbyconsulting.com> > ...I thought that's how everyone does it :) The bigger the company the more likely that is how it is done. John W. Colby www.ColbyConsulting.com William Hindman wrote: > ...I thought that's how everyone does it :) > > William > "The truth is incontrovertible, malice may attack it, ignorance may deride > it, but in the end; there it is." > > -------------------------------------------------- > From: "jwcolby" > Sent: Thursday, May 29, 2008 12:19 PM > To: "Access Developers discussion and problem solving" > ; "VBA" ; > "Discussion of Hardware and Software issues" > Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: > CTEclassification-tree editor > >> I had a very interesting conversation with my tax guy this >> morning. He had previously worked at Lowes Hardware in >> their accounting department. >> >> The upshot of the conversation was that Lowes has to >> interface to a huge number of legacy systems, systems from >> suppliers, banks, systems from companies they purchased 10 >> years ago and inherited etc. His comment of interest is >> that in many cases they did not do testing. Or more >> correctly they threw data at the live system and looked at >> what happened, and then used a feedback loop to work around >> to what the system at the other end would accept. >> >> Sounds like poor Roz at her current assignment. >> >> I have to tell you that I have experienced this same thing. >> My disability insurance call center software has to >> interface to about 10 (so far) completely different >> insurance companies. Each company has dozens of legacy >> systems. >> >> We get "specs" for how to receive and transmit data to these >> mainframe systems. I write code to meet the spec, then we >> send data. We then get feedback from them about how to >> change the program to meet the "REAL spec" which is never >> the printed spec. Iterate until the feedback stops and they >> start accepting what we send without complaint. >> >> In one case they had specified how to output claim data that >> they wanted to enter into their system. In this one >> (admittedly extreme) case it was in a vertical report >> format, which we did. Some six months later we discovered >> that the format was designed to allow some key entry person >> to key it into their system manually, and the "report order" >> was the order that the data entry fields appeared on her screen. >> >> I got a chuckle out of that one. >> >> John W. Colby >> www.ColbyConsulting.com From ebarro at verizon.net Thu May 29 20:25:25 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 29 May 2008 18:25:25 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <483F0D7E.6090905@colbyconsulting.com> References: <483ED7A3.1070206@colbyconsulting.com> <483F0D7E.6090905@colbyconsulting.com> Message-ID: <000001c8c1f4$0b018890$c403000a@advancedinput.com> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 02:21:02 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 09:21:02 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From shamil at smsconsulting.spb.ru Fri May 30 07:45:55 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 16:45:55 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: Message-ID: <000c01c8c253$1a39aa40$6401a8c0@nant> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 09:09:15 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 30 May 2008 15:09:15 +0100 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000c01c8c253$1a39aa40$6401a8c0@nant> References: <000c01c8c253$1a39aa40$6401a8c0@nant> Message-ID: <000201c8c25e$c1073ad0$8119fea9@LTVM> It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 10:42:54 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 19:42:54 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000201c8c25e$c1073ad0$8119fea9@LTVM> Message-ID: <000c01c8c26b$d393d7f0$6401a8c0@nant> Hi Max, Yes, this is why I'm wondering what Gustav means :) BTW, I do use multi-layered approach with a lot of custom classes and mainly ObjectDataSource controls for ASP.NET web forms - works very well but it needs one or another code generation tool: I did develop my own but maybe you'd better purchase existing ones if you do not have time to develop your own... For the task like yours (assuming ObjectDataSource and custom classes are used) I'd batch updates into transactions - that will need some more work than built-in approach you're trying to use but when that custom approach is used ((generated) custom classes + ObjectDataSource control + a few custom coding) then you have control on every bit of your program and you're not dependent on any new technologies MS will develop, and with some more efforts you can have different backends SQL Servers or even MS Access for different customers of the same application etc. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Friday, May 30, 2008 6:09 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Updating dataset from datagrid It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 cfoust at infostatsystems.com Fri May 30 10:50:58 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 May 2008 08:50:58 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000001c8c1f4$0b018890$c403000a@advancedinput.com> References: <483ED7A3.1070206@colbyconsulting.com><483F0D7E.6090905@colbyconsulting.com> <000001c8c1f4$0b018890$c403000a@advancedinput.com> Message-ID: I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 11:32:18 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 18:32:18 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Charlotte and Eric Exactly. It will even write pass-through queries for the asking. /gustav >>> cfoust at infostatsystems.com 30-05-2008 17:50 >>> I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 12:01:04 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 19:01:04 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav From Gustav at cactus.dk Thu May 1 01:28:56 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 08:28:56 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi all This should be doable as Novell claims Mono to be 100% compatible with ASP.NET. A two-page how-to guide is published here: http://novellevents.novell.com/t/5096990/63304383/9281/0/ The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav From wdhindman at dejpolsystems.com Thu May 1 02:24:15 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 1 May 2008 03:24:15 -0400 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux References: Message-ID: ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From pcs.accessd at gmail.com Thu May 1 02:33:10 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 17:33:10 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Message-ID: Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge From shamil at smsconsulting.spb.ru Thu May 1 02:57:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 11:57:15 +0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <4818E198.30501@colbyconsulting.com> Message-ID: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> <<< No matter how you slice it, it has to process more physical disk sectors etc. >>> Hi John, Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' fields but it would be enough to scan index entries, and even maybe non-leaf index pages' entries for the query returning every 1000th row - then the difference I thought between the time to get results from 1+ million rows data table and 90 millions wouldn't be that significant. It's obvious now that that was my wrong assumption because clustered index has actual data rows on its leaf-nodes: Clustered Index http://msdn.microsoft.com/en-us/library/ms177443.aspx Non-Clustered Index http://msdn.microsoft.com/en-us/library/ms177484.aspx New hypothesis based on info on clustered and non-clustered index structure: With *Non-clustered* index defined for your PKID the following query performance should be significantly better. Although I'd not guess now how much time it could take to get this query finished with your db: SELECT RowNum, PKID from ( select Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID from [Names]) s where (s.RowNum % 1000) = 1 union all Select NULL as RowNum, Max(PKID) as PKID from [Names] When there exists a non-clustered index together with clustered for the same field and this field is used in a query as 'order by' or as selection criteria then MS SQL uses non-clustered index as far as I see from query execution plan... Here is how I did create non-clustered index to the test table called [dbo].[Names]: if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] GO CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] ( [PKID] ASC ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO (BTW, did you ever try to create non-clustered indexes on non-PRIMARY filegroups of an MS SQL 2000/2005 database? - another tip, which could improve query performance, especially if to keep indexes' filegroups on different HDDs - and the latter could be not backed-up because indexes can be rebuilt anytime, and building non-clustered indexes should be non that time consuming even for 90 million records DB? ) Please feel free to check or ignore the new hypothesis with your 90 million db table... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 1:16 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] vb.net - Updates I do have the clustered stuff exactly as you show: > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > IGNORE_DUP_KEY = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > ) ON [PRIMARY] Likewise I am getting the same 99% cost clustered index scan. I have to guess it is something else. There is a lot of empty space in the database file which I will compact out tonight. It takes hours because of the size and when it is doing that I cannot use the db. Perhaps I have severe fragmentation or something. The database size is 300 GIGS. And finally just remember that when all is said and done it is still a hundred times larger than your database. No matter how you slice it, it has to process more physical disk sectors etc. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu May 1 03:05:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 12:05:40 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: Message-ID: <034201c8ab62$25a2cc70$6401a8c0@nant> Hi Borge, Just remove these lines, which do not compile - those are attributes used internally by VB6: VBA has some similar attributes but you usually do not need to change them from within VBA's IDE.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Thursday, May 01, 2008 11:33 AM To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge _______________________________________________ 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 Thu May 1 03:14:43 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 10:14:43 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi William No don't. The article is about the _server_ side! /gustav >>> wdhindman at dejpolsystems.com 01-05-2008 09:24 >>> ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav From jwcolby at colbyconsulting.com Thu May 1 06:10:13 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 07:10:13 -0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <034201c8ab62$25a2cc70$6401a8c0@nant> References: <034201c8ab62$25a2cc70$6401a8c0@nant> Message-ID: <4819A515.9080300@colbyconsulting.com> Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 Thu May 1 06:27:39 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 15:27:39 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <4819A515.9080300@colbyconsulting.com> Message-ID: <036d01c8ab7e$5d8845e0$6401a8c0@nant> John, May I argue that Borge just needs to get VB6 code reused (copied and pasted) in his VBA project? Let's ask Borge? Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 3:10 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 pcs.accessd at gmail.com Thu May 1 07:08:11 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 22:08:11 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <036d01c8ab7e$5d8845e0$6401a8c0@nant> References: <4819A515.9080300@colbyconsulting.com> <036d01c8ab7e$5d8845e0$6401a8c0@nant> Message-ID: Hi guys, I was going to just say please disregard my post... But this is what happened: I have this HTTPClass.cls from http://www.paradoxes.info/code/HTTPClass.html We are using it to send data across the internet to a service provider who does Text To Speech (TTS) for us, then sends out phone calls, receives the keys press feed back from the clients - which in turn is sent back to us via another process ... used for identifying short term relief staff to fill short term vacancies in different industries .... So far I had been using the properties from a .dll created on the class and referenced into the VBA project. Questions came up about the format of the parameters we are sending across, so I had to start look into this thing and pick out the string that is actually being sent. So I thought I try and import the .cls into a class module and run the class in the VBA project so I can debug.print the POSTDATA string of the SendRequest function... (see the code on the website...) To answer your question: I did Insert > ClassModule > Pasted the Code from HTTPSClass.cls > Compiled Code > Saved the Class Module No problems! What prompted my question was that I had opened the .cls file in VisualStudio and it had added the Version and Attribute lines I was having problem with - which turns out is not part of the original .cls file and is totally unnecessary .. John and Shamil, thanks for responding... regards borge On Thu, May 1, 2008 at 9:27 PM, Shamil Salakhetdinov < shamil at smsconsulting.spb.ru> wrote: > John, > > May I argue that Borge just needs to get VB6 code reused (copied and > pasted) > in his VBA project? Let's ask Borge? > > Thanks. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 3:10 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Shamil, > > If you notice the Exposed and creatable properties, it appears that he > is trying to make the class viewable from outside of a library. Just > deleting those lines will prevent that. > > He needs to do the Insert Class, Insert file thing. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: > > Hi Borge, > > > > Just remove these lines, which do not compile - those are attributes > used > > internally by VB6: VBA has some similar attributes but you usually do > not > > need to change them from within VBA's IDE.... > > > > -- > > Shamil > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > > Sent: Thursday, May 01, 2008 11:33 AM > > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > > > Hi there, > > > > I am swimming in the deep end of the pool and threading water so to > speak > > .... I need help! > > > > I have imported a VB6 .cls file into VBA > > > > The following shows up in red and will not compile > > > > 'Will not compile : > > VERSION 1.0 CLASS > > > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > 'End of lines not compiling > > > > Here is the beginning of the module - it's the HTTPClass.cls from > available > > from some VB6 website, can't remember the link right now ...; > > all other code lines appear ok in VBA > > > > What do I need to do?? > > > > > > > > '**** Beginning of VBA Class Module :: > > Option Compare Database > > Option Explicit > > VERSION 1.0 CLASS > > BEGIN > > MultiUse = -1 'True > > Persistable = 0 'NotPersistable > > DataBindingBehavior = 0 'vbNone > > DataSourceBehavior = 0 'vbNone > > MTSTransactionMode = 0 'NotAnMTSObject > > End > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > > > Public Enum ePort > > INTERNET_DEFAULT_HTTP_PORT = 80 > > INTERNET_DEFAULT_HTTPS_PORT = 443 > > End Enum > > ... > > > > > > Regards > > borge > > _______________________________________________ > > 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 Thu May 1 07:10:05 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:10:05 -0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> References: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> Message-ID: <4819B31D.2060706@colbyconsulting.com> I have many indexes set up which include the PKID and one or more other fields. One would think that the optimizer would use one of those indexes instead of the clustered PKID index. I am thinking that a hint is in order to force SQL Server to use a different index. That is beyond my expertise however. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > <<< > No matter how you slice it, it has to process > more physical disk sectors etc. > Hi John, > > Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' > fields but it would be enough to scan index entries, and even maybe non-leaf > index pages' entries for the query returning every 1000th row - then the > difference I thought between the time to get results from 1+ million rows > data table and 90 millions wouldn't be that significant. It's obvious now > that that was my wrong assumption because clustered index has actual data > rows on its leaf-nodes: > > Clustered Index > http://msdn.microsoft.com/en-us/library/ms177443.aspx > > Non-Clustered Index > http://msdn.microsoft.com/en-us/library/ms177484.aspx > > > New hypothesis based on info on clustered and non-clustered index structure: > With *Non-clustered* index defined for your PKID the following query > performance should be significantly better. Although I'd not guess now how > much time it could take to get this query finished with your db: > > SELECT RowNum, PKID from ( select > Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID > from [Names]) s > where (s.RowNum % 1000) = 1 > union all > Select NULL as RowNum, Max(PKID) as PKID from [Names] > > When there exists a non-clustered index together with clustered for the same > field and this field is used in a query as 'order by' or as selection > criteria then MS SQL uses non-clustered index as far as I see from query > execution plan... > > Here is how I did create non-clustered index to the test table called > [dbo].[Names]: > > if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') > DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > GO > > CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > SORT_IN_TEMPDB = OFF, > IGNORE_DUP_KEY = OFF, > DROP_EXISTING = OFF, > ONLINE = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) > ON [PRIMARY] > GO > > (BTW, did you ever try to create non-clustered indexes on non-PRIMARY > filegroups of an MS SQL 2000/2005 database? - another tip, which could > improve query performance, especially if to keep indexes' filegroups on > different HDDs - and the latter could be not backed-up because indexes can > be rebuilt anytime, and building non-clustered indexes should be non that > time consuming even for 90 million records DB? ) > > Please feel free to check or ignore the new hypothesis with your 90 million > db table... > > Thank you. > > -- > Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 1:16 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] vb.net - Updates > > I do have the clustered stuff exactly as you show: > > > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > > ( > > [PKID] ASC > > ) > > WITH (PAD_INDEX = OFF, > > STATISTICS_NORECOMPUTE = OFF, > > IGNORE_DUP_KEY = OFF, > > ALLOW_ROW_LOCKS = ON, > > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > > ) ON [PRIMARY] > > Likewise I am getting the same 99% cost clustered index scan. > > I have to guess it is something else. There is a lot of empty space in > the database file which I will compact out tonight. It takes hours > because of the size and when it is doing that I cannot use the db. > Perhaps I have severe fragmentation or something. The database size is > 300 GIGS. And finally just remember that when all is said and done it > is still a hundred times larger than your database. No matter how you > slice it, it has to process more physical disk sectors etc. > > 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 jwcolby at colbyconsulting.com Thu May 1 07:37:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:37:44 -0400 Subject: [dba-VB] System not responding for seconds at a time Message-ID: <4819B998.40507@colbyconsulting.com> I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Thu May 1 08:28:46 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 01 May 2008 06:28:46 -0700 Subject: [dba-VB] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> Message-ID: <0K0600GA3YRY8146@vms173001.mailsrvcs.net> John, Try Process Explorer from SysInternals. It shows everything that's running on your machine. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx And yes SQL server does in fact take up a lot of memory when shrinking files. I would stop the sql server and the sql server agent using Services in Control Panel->Admin Tools but make sure it is not writing to the disk first. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 5:38 AM To: Discussion of Hardware and Software issues; VBA; Dba-Sqlserver Subject: [dba-VB] System not responding for seconds at a time I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- 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 jwcolby at colbyconsulting.com Thu May 1 08:30:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 09:30:44 -0400 Subject: [dba-VB] [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> Message-ID: <4819C604.4000901@colbyconsulting.com> Well... it appears that I have fixed the issue. After Googling "slow server response time" or something similar I ran across references to a "Maximum Memory" property for SQL Server. I finally found that and it was set to something insane like 200000000 MEGABYTES (several petabytes of server memory). While I can dream of such a machine, it ain't happening here! I adjusted the Maximum Memory down to 2 gigs and the "amount available" in Task Manager Performance tab popped up to 4 gigs. Having done that, and after perhaps 30 seconds, suddenly my machine is responding in a normal way. I am now adjusting that number to "leave" perhaps 2 gigs available to applications other than SQL Server. I probably don't even need 2 gigs but it is critical that I don't end up unable to do anything on that machine. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I don't quite know where to address this so I am cross posting it. I am > working on a fairly powerful server running Windows 2003 x64 and SQL > Server 2003 x64. It has 8 gigs of memory. No malware software, > software firewall, virus scanner etc. Nothing. > > I am running a file shrink on the SQL Server file, trying to remove > about 140 gigs of empty space. That process has been running since last > night, well over 8 hours now. It APPEARS that process is using all of > available memory since task manager shows only about 200 megs > "available". However if you look at the process tab, no process says it > is using more than 100 megs of ram. The performance tab shows almost no > CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then > only one of the cores appears to be doing anything. > > The computer is "stuttering" badly. Try to do anything - change to a > different program, page up in visual studios code etc, and the computer > will usually hesitate before doing whatever you requested. I am trying > to work on a VB project and can't get anything done because as I move > around in the doc it may take 2 to 5 seconds just to respond to my > request to move my cursor. > > Has anyone seen SQL Server lock up the the system like this, IOW is it > SQL Server? Does anyone know how long the file shrink could take - > days, weeks, months? Does anyone know how to cancel the file shrink? > This is the most powerful server I have, quad core, running x64 > software, 8 gigs, high speed raid arrays etc. > > Unfortunately I was in the middle of a vb.net project yesterday before I > started the shrink running after work and the server is unusable for > anything right now. > From accessd at shaw.ca Thu May 1 18:27:16 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 16:27:16 -0700 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux In-Reply-To: References: Message-ID: <803E0A4449764EF0AE3F013A4B9443AF@creativesystemdesigns.com> That is stellar news Gustav. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, April 30, 2008 11:29 PM To: The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav _______________________________________________ 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 May 2 06:00:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:00:19 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... Message-ID: <044901c8ac43$b6314e10$6401a8c0@nant> Hi All, Anybody lucky here to manage to find where to download "Classifieds Web Site Starter Kit"? The link on its web site hosted by MS http://www.asp.net/downloads/starter-kits/classifieds/ seems to be brokwen as well as on some other sites, which all refer this broken link. Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 06:08:42 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 07:08:42 -0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... References: <044901c8ac43$b6314e10$6401a8c0@nant> Message-ID: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 06:38:20 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:38:20 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... In-Reply-To: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Message-ID: <045001c8ac49$083bb560$6401a8c0@nant> Thank you, Michael! Yes, discountasp.net has a link, which leads to correct "Classifieds Web Site Starter Kit Download": http://download.microsoft.com/download/e/d/d/edd838dc-d369-403f-a5e0-d1ca2b5 be0be/class.vsi -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys Sent: Friday, May 02, 2008 3:09 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Classifieds Web Site Starter Kit Download... Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 08:53:11 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 17:53:11 +0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial on CodeProject Message-ID: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Hi All, I have found the following article as a good source on WinForms databinding with custom classes: A Detailed WinForns Data Binding Tutorial http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx Was it mentioned here already? Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 10:31:28 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 11:31:28 -0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject References: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Message-ID: <00ce01c8ac69$9825b250$0502a8c0@Laptop> Hi Shamil, No, I hadn't seen this before. Thank you! Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 9:53 AM Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject > Hi All, > > I have found the following article as a good source on WinForms > databinding > with custom classes: > > A Detailed WinForns Data Binding Tutorial > > http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx > > Was it mentioned here already? > > Thank you. > > -- > Shamil > > _______________________________________________ > 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 May 2 12:35:52 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:35:52 -0400 Subject: [dba-VB] Visual Studio 2008 Message-ID: <481B50F8.5020202@colbyconsulting.com> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 2 12:43:58 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 02 May 2008 19:43:58 +0200 Subject: [dba-VB] Visual Studio 2008 Message-ID: Hi John I have both installed. Only task on Vista was to download and install a large update for VS2005 which it announces when the initial install has finished. /gustav >>> jwcolby at colbyconsulting.com 02-05-2008 19:35 >>> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri May 2 12:47:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:47:26 -0400 Subject: [dba-VB] Visual Studio 2008 In-Reply-To: <481B50F8.5020202@colbyconsulting.com> References: <481B50F8.5020202@colbyconsulting.com> Message-ID: <481B53AE.4080802@colbyconsulting.com> Other than learn how to spell? ;-) John W. Colby www.ColbyConsulting.com jwcolby wrote: > Can VS2008 co-habitate with 2005? Andything special I need to do? > From Gustav at cactus.dk Sun May 4 02:23:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 09:23:53 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi all What do you use as feed for the Start Page? If any? I noticed that neither in VS2005 nor VS2008 the Start Page has been updated since the initial install. In VS2008 this URL is created: http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 It links to: http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml which has a last entry of Mar. 20th. That explains. But why does VS install this? I located via Google another feed: http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml which seems to update. But that is not C#. /gustav From wdhindman at dejpolsystems.com Sun May 4 02:45:49 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 4 May 2008 03:45:49 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <4E8801746B1B499B88AD78BD3B3E542F@jislaptopdev> ...nice find Gustav ...I'd just eliminated the start page altogether ...I'll have to give this a shot :) William -------------------------------------------------- From: "Gustav Brock" Sent: Sunday, May 04, 2008 3:23 AM To: " Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From mmattys at rochester.rr.com Sun May 4 06:53:16 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 07:53:16 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <002501c8addd$71922540$0502a8c0@Laptop> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /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 Sun May 4 07:01:35 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 04 May 2008 08:01:35 -0400 Subject: [dba-VB] SQL Server timeouts Message-ID: <481DA59F.5060503@colbyconsulting.com> I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Sun May 4 07:46:05 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 08:46:05 -0400 Subject: [dba-VB] SQL Server timeouts References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <005401c8ade4$d20375d0$0502a8c0@Laptop> While I was on Amazon a few days ago, the key word "Tuning" caught my eye - - so I looked it up. This might help, but do Google: http://www.codeproject.com/KB/database/sql-tuning-tutorial-1.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: "VBA" ; "Dba-Sqlserver" Sent: Sunday, May 04, 2008 8:01 AM Subject: [dba-VB] SQL Server timeouts >I am running this process that updates SQL Server from VB.Net. The > process runs normally for tens of millions of records, then SQL Server > "hangs" and stops servicing requests (from this process), either reads > or writes. It just times out with error messages "Timeout Expired: The > timeout period expired prior to completion of the operation or SQL > Server is not responding". > > This is not a once off occurrence, it happens every time I start the > process running. Sometimes I get this and then eventually SQL Server > will start responding, sometimes it just stops responding. > > How do I troubleshoot this? > -- > 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 mikedorism at verizon.net Sun May 4 08:07:01 2008 From: mikedorism at verizon.net (Doris Manning) Date: Sun, 04 May 2008 09:07:01 -0400 Subject: [dba-VB] SQL Server timeouts In-Reply-To: <481DA59F.5060503@colbyconsulting.com> References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <000901c8ade7$be7d6a40$2d01a8c0@Kermit> The culprit is probably a system database called "tempdb". This database gets reset each time you stop and restart SQL Server. In my world, I had to create a job to shrink it every hour in order to resolve this issue. http://sqlserver2000.databases.aspfaq.com/why-is-tempdb-full-and-how-can-i-p revent-this-from-happening.html Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, May 04, 2008 8:02 AM To: VBA; Dba-Sqlserver Subject: [dba-VB] SQL Server timeouts I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- 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 Gustav at cactus.dk Sun May 4 08:39:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 15:39:07 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi Michael Some typos here? Should be, I guess: http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 Links to: http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml /gustav >>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav From mmattys at rochester.rr.com Sun May 4 09:30:11 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 10:30:11 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <006801c8adf3$5cf9c4b0$0502a8c0@Laptop> Sorry, working from two laptops ... one connected, one protected. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: Sent: Sunday, May 04, 2008 9:39 AM Subject: Re: [dba-VB] VS Start Page feed > Hi Michael > > Some typos here? Should be, I guess: > http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 > > Links to: > http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml > > /gustav > >>>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> > Mine says: > > (Last update Fri., May 2) > http://go.microsoft.com/flink/?linkid45191&clcid=409 > > Michael R. Mattys > MapPoint & Access Dev > www.mattysconsulting.com > > ----- Original Message ----- > From: "Gustav Brock" > To: " > Sent: Sunday, May 04, 2008 3:23 AM > Subject: [dba-VB] VS Start Page feed > > >> Hi all >> >> What do you use as feed for the Start Page? If any? >> >> I noticed that neither in VS2005 nor VS2008 the Start Page has been >> updated since the initial install. >> In VS2008 this URL is created: >> >> http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 >> >> It links to: >> >> http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml >> >> which has a last entry of Mar. 20th. >> That explains. But why does VS install this? >> >> I located via Google another feed: >> >> http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml >> >> which seems to update. But that is not C#. >> >> /gustav > > > > _______________________________________________ > 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 May 5 08:03:23 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 17:03:23 +0400 Subject: [dba-VB] FYI: Programming ftp in .NET Message-ID: <05ed01c8aeb0$68210250$6401a8c0@nant> Hi All, It happens that basic FTP access - login, change dir, upload and download can be relatively easy programmed by using this free code - http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm ... I have found just one issue: while uploading a file having left or right curly bracket - '{' or '}' in ASCII mode I'm getting "Input line wasn't in correct format" runtime error on this code line: public class FTPClient ... private void PutASCII(Stream srcStream, string remoteFile, bool append) ... writer.Write(line, 0, line.Length); ... When I make curly bracket duplicated then it works well, but then download doesn't work again breaking on curly bracket... Have you seen issues like that? (I guess I have here FTP protocol specs violation in the case of curly brackets?) In BINARY mode everything seems to work well, therefore issue isn't that critical still I'd be interested to know what other chars could result in runtime errors? And how to properly escape curly brackets to implement FTP put and get in ASCII mode.... BTW, in P.S. you can find simple C# Windows Console app FTP test of the referred above free source Thanks. -- Shamil P.S. using System; using System.Collections.Generic; using System.Text; using com.enterprisedt.net.ftp; using FTP; namespace FTPTestConsole { class Program { private static void logger_OnLoggableEvent(object o, LogInfoEventArgs e) { //lbProgress.Items.Add(e.Message); //lbProgress.SelectedIndex = lbProgress.Items.Count - 1; //Application.DoEvents(); Console.WriteLine(e.Message); } private static string _host = "{{yourHostHere}}"; private static string _userId = "{{yourUserNameHere}}"; private static string _password = "{{yourPasswordHere}}"; private static string _ftpFolder = "testUp"; private static string _localUploadedFileFullPath = @"E:\temp\up.txt"; private static string _localDownloadedFileFullPath = @"E:\temp\OK.txt"; private static string _remoteFileName = "test.txt"; static void Main(string[] args) { try { // Create and register a logger FTP.Logger logger = new FTP.Logger(); //logger.OnLoggableEvent += new FTP.Logger.LoggableEventHandler(logger_OnLoggableEvent); logger.OnLoggableEvent += new Logger.LoggableEventHandler(logger_OnLoggableEvent); // create an instance of FTPClient, passing in the name of hte host, the time out // and the logger for updates string host = _host; com.enterprisedt.net.ftp.FTPClient ftpClient = new com.enterprisedt.net.ftp.FTPClient(host); // call login, passing in the user id and the password string user = _userId; string pw = _password; ftpClient.Login(user, pw); // change directory on the host logger.Write(null, "Client requesting change directory to " + _ftpFolder); string newDirectory = _ftpFolder; ftpClient.Chdir(newDirectory); // send a file to the host (rename it there) logger.Write(null, "Client calling Put(" + _localUploadedFileFullPath + "," + _remoteFileName + ")"); string localFileName = _localUploadedFileFullPath; string remoteFileName = _remoteFileName; //ftpClient.Put(localFileName, remoteFileName); ftpClient.TransferType = FTPTransferType.BINARY; ftpClient.Put(localFileName, remoteFileName); // ge the file back from the host, rename it here logger.Write(null, "Client calling Get(" + _localDownloadedFileFullPath + "," + _remoteFileName + ")"); string newFileName = _localDownloadedFileFullPath; ftpClient.Get(newFileName, remoteFileName); // clean up and go home logger.Write(null, "Client calling quit"); ftpClient.Quit(); logger.Write(null, "Done."); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } } From jwcolby at colbyconsulting.com Mon May 5 08:06:01 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 09:06:01 -0400 Subject: [dba-VB] SQL Server WHERE Clause order Message-ID: <481F0639.2090300@colbyconsulting.com> Does it make any difference in SQL Server the order of the WHERE clause items. For example: WHERE (LastName IS NOT NULL) AND (AGE > 30) vs WHERE (AGE > 30) AND (LastName IS NOT NULL) -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:23:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:23:26 -0400 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: <481F266E.9020104@colbyconsulting.com> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:41:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:41:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F2AAB.7060109@colbyconsulting.com> When I type ?string.format("yyyyMMdd",Date.Today) into the debug window I get yyyyMMdd (the literal string) not 20080505. What am I doing wrong? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 10:43:08 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 19:43:08 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> Message-ID: <061d01c8aec6$b73dafd0$6401a8c0@nant> Hi John, This should be it: Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) Console.WriteLine(dt) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:23 PM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 mikedorism at verizon.net Mon May 5 10:46:24 2008 From: mikedorism at verizon.net (Doris Manning) Date: Mon, 05 May 2008 11:46:24 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <000601c8aec7$2cc87a00$2d01a8c0@Kermit> JC, Try using... Format(Date.Now, "yyyyMMdd-hhmmss") Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 11:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Gustav at cactus.dk Mon May 5 10:51:41 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 05 May 2008 17:51:41 +0200 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: Hi John Here's a good reference on date format strings with lots of samples: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx /gustav >>> jwcolby at colbyconsulting.com 05-05-2008 17:23 >>> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:59:03 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:59:03 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <061d01c8aec6$b73dafd0$6401a8c0@nant> References: <061d01c8aec6$b73dafd0$6401a8c0@nant> Message-ID: <481F2EC7.8020700@colbyconsulting.com> Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 11:17:13 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 20:17:13 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <062401c8aecb$7a495700$6401a8c0@nant> OK - DateTime.Now.ToString("yyyyMMdd-hhmmss") should work well also. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Mon May 5 11:40:43 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 5 May 2008 09:40:43 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <003801c8aece$c32188f0$0200a8c0@murphy3234aaf1> Hi John, I have an app that does something similar with wav files. What I use to time stamp the files is to use the time as the file name as follows. sFileName = sFolder & CStr(DatePart("h", Now)) & "_" & CStr(DatePart("n", Now)) & "_" & CStr(DatePart("s", Now)) & ".wav" May not be elegant but it works. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Mon May 5 11:46:42 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 5 May 2008 09:46:42 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: I would strongly suggest you use an underscore rather than a hyphen in your file name. We've encountered various situations where the hyphen is treated as an invalid character, particularly when transferring files electronically. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com _______________________________________________ From jwcolby at colbyconsulting.com Mon May 5 12:07:37 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 13:07:37 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F3ED9.9020100@colbyconsulting.com> I can do that. Thanks. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > I would strongly suggest you use an underscore rather than a hyphen in > your file name. We've encountered various situations where the hyphen > is treated as an invalid character, particularly when transferring files > electronically. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 8:23 AM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > > -- > 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 jwcolby at colbyconsulting.com Tue May 6 15:50:18 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 May 2008 16:50:18 -0400 Subject: [dba-VB] SP1 - how do you tell Message-ID: <4820C48A.4060406@colbyconsulting.com> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue May 6 16:00:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 May 2008 23:00:07 +0200 Subject: [dba-VB] SP1 - how do you tell Message-ID: Hi John Mine tells: Version 8.0.50727.867 (vvista.050727-8600) /gustav >>> jwcolby at colbyconsulting.com 06-05-2008 22:50 >>> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed May 7 06:53:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 May 2008 15:53:15 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <07c101c8b038$ef88b470$6401a8c0@nant> Hi John, Please make correction to your string formatting: Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) Console.WriteLine(dt) IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the hour value in 00 - 11 range, and you might get file names collisions: yes, very low probability to get such collisions but "Murphy Laws" are waiting us, developers, around every corner, you know, and we have to be very accurate, and a little bit "paranoid"... Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ 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 May 7 07:05:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 07 May 2008 08:05:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <07c101c8b038$ef88b470$6401a8c0@nant> References: <07c101c8b038$ef88b470$6401a8c0@nant> Message-ID: <48219B0B.7040901@colbyconsulting.com> Thanks for that Shamil. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Please make correction to your string formatting: > > Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) > Console.WriteLine(dt) > > IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the > hour value in 00 - 11 range, and you might get file names collisions: yes, > very low probability to get such collisions but "Murphy Laws" are waiting > us, developers, around every corner, you know, and we have to be very > accurate, and a little bit "paranoid"... > > Thanks. > > -- > Shamil From max.wanadoo at gmail.com Thu May 8 02:42:37 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 8 May 2008 08:42:37 +0100 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <05ed01c8aeb0$68210250$6401a8c0@nant> References: <05ed01c8aeb0$68210250$6401a8c0@nant> Message-ID: <000301c8b0df$16739bd0$8119fea9@LTVM> Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max From fhtapia at gmail.com Thu May 8 08:08:28 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 06:08:28 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: I am in the middle of testing it, I will post back when I have completed my tests On 5/8/08, Max Wanadoo wrote: > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From dwaters at usinternet.com Thu May 8 08:12:07 2008 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 8 May 2008 08:12:07 -0500 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: <001301c8b10d$1e4579e0$0300a8c0@danwaters> When I tried to install it by the normal method, I got an 'Access Denied' error during installation. It did gracefully uninstall all the SP3 files and I'm back to where I was no worse for the wear. I downloaded the update (about 30 minutes w/DSL) and I'll try next with that. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Thursday, May 08, 2008 2:43 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] XP Service Pack 3 and Access Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max _______________________________________________ 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 Thu May 8 11:29:49 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 08 May 2008 18:29:49 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From jwcolby at colbyconsulting.com Thu May 8 13:05:06 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 08 May 2008 14:05:06 -0400 Subject: [dba-VB] Dual boot Server 2003 X32 and x64 Message-ID: <482340D2.5090608@colbyconsulting.com> Does anyone know if it is possible to dual boot the x32 and x64 version of windows 2k3? My concern in doing so is that on the one server that I run 2k3 x64 on, there are two program file directories, one called Program Files the other called Program Files (x86). It APPEARS that the (x86) directory is the 32 bit directory which would imply that the one without was the x64, though I have nothing more to base that on than the names of the directories inside of each Program Files directory. I just got a 2nd Phenom quad core and want to convert a second system to quad core x64. The EASIEST way would be to dual boot until I have everything I need running in x64 and then cut over. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu May 8 13:47:26 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 11:47:26 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <001301c8b10d$1e4579e0$0300a8c0@danwaters> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> <001301c8b10d$1e4579e0$0300a8c0@danwaters> Message-ID: I downloaded the file straight from the download center and did a normal install On Thu, May 8, 2008 at 6:12 AM, Dan Waters wrote: > When I tried to install it by the normal method, I got an 'Access Denied' > error during installation. It did gracefully uninstall all the SP3 files > and I'm back to where I was no worse for the wear. > > I downloaded the update (about 30 minutes w/DSL) and I'll try next with > that. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo > Sent: Thursday, May 08, 2008 2:43 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: [dba-VB] XP Service Pack 3 and Access > > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From mikedorism at verizon.net Thu May 8 16:43:29 2008 From: mikedorism at verizon.net (Doris Manning) Date: Thu, 08 May 2008 17:43:29 -0400 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: <001801c8b154$8e4561a0$2d01a8c0@Kermit> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Thu May 8 17:14:14 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 00:14:14 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Thu May 8 17:47:10 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 8 May 2008 15:47:10 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 May 9 03:50:12 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 10:50:12 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /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 Gustav at cactus.dk Fri May 9 05:36:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 12:36:19 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From Gustav at cactus.dk Fri May 9 06:22:33 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 13:22:33 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Here's a simple dirty trick to force a validate of a CheckBox: Hide the checkbox, Show it again and set Focus. As the control looses focus, Validating and Validated will fire. The previous control will get focus. You show the control again and move focus back (and the Validating and Validated events of the previous control will fire). It happens so fast that nothing strange is to be seen for the user. private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.checkBoxRegistered.Hide(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Show(); this.checkBoxRegistered.Focus(); // Focus has been retained. // Validating and Validated of the previous control will fire. } Another option is to have a tiny dummy control containing no event code where focus temporarily can be stoved away: private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.noop.Focus(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Focus(); // Focus has been regained. // Validating and Validated of the dummy control will fire. } /gustav >>> Gustav at cactus.dk 09-05-2008 10:50 >>> Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Fri May 9 10:45:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 9 May 2008 08:45:06 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.as px The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Mon May 12 14:50:05 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 12 May 2008 21:50:05 +0200 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... Message-ID: Hi all Anyone encountered this nasty bug? It seems to have lived for years(!): http://forums.microsoft.com/msdn/showpost.aspx?postid=277680&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=10 I have a Winform with a DataGridView and some bound textboxes. Data source is a DataTable. Update goes like this: this.Validate(true); this.mediaBindingSource.EndEdit(); this.mediaTableAdapter.Update(this.MyAdapter.Media); Sometimes after multiple but not stressed updates, the exception error is raised. Any ideas or workarounds? /gustav From mikedorism at verizon.net Tue May 13 06:15:30 2008 From: mikedorism at verizon.net (Doris Manning) Date: Tue, 13 May 2008 07:15:30 -0400 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... In-Reply-To: References: Message-ID: <000001c8b4ea$a88b7d80$2d01a8c0@Kermit> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Doris It doesn't. However, I think I tracked down the issue after much trial and error. It happens if you perform multiple updates of the same row when an update is called immediately following each value change of several controls via the GUI. By only performing one update for each row, the issue seems to stay dormant. /gustav >>> mikedorism at verizon.net 13-05-2008 13:15 >>> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Charlotte and Doris I've found that if you bind a DataTable to a non-tristate CheckBox and try to insert a new row having set Checked to either True or False but without specifying the CheckState property, the insert will fail because CheckState will pass a DBNull to the DataTable. Thus, you must bind the CheckState property to the DataTable and - for a new record - set CheckState to either Checked or Unchecked. /gustav >>> cfoust at infostatsystems.com 09-05-2008 17:45 >>> We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From shamil at smsconsulting.spb.ru Tue May 20 12:29:50 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 21:29:50 +0400 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN In-Reply-To: <4812075D.6000306@colbyconsulting.com> Message-ID: <11cb01c8ba9f$1c873ad0$6401a8c0@nant> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- 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 shamil at smsconsulting.spb.ru Tue May 20 14:16:41 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 23:16:41 +0400 Subject: [dba-VB] Fail Fast Message-ID: <11e301c8baae$08c911d0$6401a8c0@nant> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From cfoust at infostatsystems.com Tue May 20 14:32:37 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 May 2008 12:32:37 -0700 Subject: [dba-VB] Fail Fast In-Reply-To: <11e301c8baae$08c911d0$6401a8c0@nant> References: <11e301c8baae$08c911d0$6401a8c0@nant> Message-ID: Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 Wed May 21 16:48:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 22 May 2008 01:48:22 +0400 Subject: [dba-VB] Fail Fast In-Reply-To: Message-ID: <137801c8bb8c$649cc3b0$6401a8c0@nant> Hi Charlotte, Thank you for sharing your experience on the subject. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, May 20, 2008 11:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Fail Fast Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 paul.hartland at googlemail.com Fri May 23 06:25:46 2008 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 23 May 2008 12:25:46 +0100 Subject: [dba-VB] Using MapPoint To Get Driving Distance Message-ID: <38c884770805230425k514699dcq1fadc18ee59e7184@mail.gmail.com> To all, I am trying to get driving distance from MapPoint 2006 using Visual Basic 6.0, which I have done. The problem being that it takes roughly two seconds to retrieve the distance. Has anyone had any experience of doing something similar and could possibly point me in the right direction of finding a faster way. Two seconds doesn't sound like a long time, but when we want to schedule about 30 people on a job, this adds around a minute to get the distance's from the employees postcode to the client's postcode. Also I am having trouble with some postcodes especially BT8 (Ireland), if you type BT8 it will not find the location, however if you put the address in it finds it and shows the postcode as BT8, where in Google maps it will find BT8 without a problem. Thank you in advance for any help on this matter..... -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri May 23 13:00:22 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:00:22 +0200 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN Message-ID: Hi Shamil Thanks for that link. As I read it, Bazaar could be the choice: http://bazaar-vcs.org However, not a single word of integration with Visual Studio except for a "dead" plug-in for VS2005 ... To me, that settles it. No Bazaar for me. Anyone with some experience of Bazaar? /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 19:29 >>> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 23 13:35:37 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:35:37 +0200 Subject: [dba-VB] Fail Fast Message-ID: Hi Shamil I like that approach, actually I once had the idea that error messages should be localized ... The article mentions an example of the type: On Error .. let value of variable x = 10 That is plain bad code in my opinion and makes a discussion on what approach to use difficult. However, when I think about it - encouraged by your posting - in Access I don't use error handling that much and mostly on a general level to catch disk/network errors and the like. I run so many tests on various user inputs during development that the code is virtually bug free. Well, of course not, but the level is so low that it doesn't pay off to do more about it. In most installations of our software we see zero errors a year caused by the software itself. Errors met are caused by network or hardware malfunction. With Visual Studio it is different but similar. I've found that when an error is raised, the message is so informative that I don't need more information. Also the stack window is a great help and - again - the IDE of VS demonstrated its superiority at a surprising level when I noticed the first time that code lines with jumps to other code modules are highlighted. Of course I include a try/catch here and there but I prefer to check for potential errors - like a lost connection before running a major update routine. Further, to my surprise, VS lets some errors pass which don't have to stop the code, indeed formatting errors for empty strings. This is certainly an indication of a value not intended, so I turned on the setting that will raise an error in such cases. Put a check mark in Thrown here: Debug, Exceptions ..., Common Language Runtime Exceptions, System, System.FormatException /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 21:16 >>> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri May 23 18:03:51 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 May 2008 19:03:51 -0400 Subject: [dba-VB] CDO Email Message-ID: <48374D57.2060502@colbyconsulting.com> Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Sat May 24 11:05:54 2008 From: ebarro at verizon.net (Eric Barro) Date: Sat, 24 May 2008 09:05:54 -0700 Subject: [dba-VB] CDO Email In-Reply-To: <48374D57.2060502@colbyconsulting.com> References: <48374D57.2060502@colbyconsulting.com> Message-ID: <001f01c8bdb8$0f922fd0$1003000a@advancedinput.com> When you send via your forwarding SMTP server using Thunderbird are you sending (via the email client) authentication? I have to assume that most SMTP servers today expect both username and password to authenticate before they even allow you to send mail out via the SMTP service. There's a setting for authentication that you need to send. mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti cate", 1); ' set to authenticate mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername ", uxSMTPUser.Text); 'send the smtp username mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword ", uxSMTPPassword.Text); 'send the smtp password You can adapt that .NET code for your use. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, May 23, 2008 4:04 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] CDO Email Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- 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 jwcolby at colbyconsulting.com Thu May 29 11:19:47 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 12:19:47 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTE classification-tree editor In-Reply-To: References: Message-ID: <483ED7A3.1070206@colbyconsulting.com> I had a very interesting conversation with my tax guy this morning. He had previously worked at Lowes Hardware in their accounting department. The upshot of the conversation was that Lowes has to interface to a huge number of legacy systems, systems from suppliers, banks, systems from companies they purchased 10 years ago and inherited etc. His comment of interest is that in many cases they did not do testing. Or more correctly they threw data at the live system and looked at what happened, and then used a feedback loop to work around to what the system at the other end would accept. Sounds like poor Roz at her current assignment. I have to tell you that I have experienced this same thing. My disability insurance call center software has to interface to about 10 (so far) completely different insurance companies. Each company has dozens of legacy systems. We get "specs" for how to receive and transmit data to these mainframe systems. I write code to meet the spec, then we send data. We then get feedback from them about how to change the program to meet the "REAL spec" which is never the printed spec. Iterate until the feedback stops and they start accepting what we send without complaint. In one case they had specified how to output claim data that they wanted to enter into their system. In this one (admittedly extreme) case it was in a vertical report format, which we did. Some six months later we discovered that the format was designed to allow some key entry person to key it into their system manually, and the "report order" was the order that the data entry fields appeared on her screen. I got a chuckle out of that one. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > A local computer paper brought attention to this work related to Daimler-Chrysler but useful in many areas: > > http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 > > > This page contains papers on the classification-tree method CTM and the classification-tree editor CTE. The classification-tree method is a testing method for the systematic design of test cases on basis of the specification. The classification-tree editor is a graphical editor supporting the application of the classification-tree method. CTM and CTE are widely used in industrial practice. > > > The CTE software is free to download and use and the page contains links to a bunch of documentation. > Here's an intro: > > http://www.systematic-testing.com/documents/eurostar2000.pdf > > > > > From wdhindman at dejpolsystems.com Thu May 29 15:04:31 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 29 May 2008 16:04:31 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: ...I thought that's how everyone does it :) William "The truth is incontrovertible, malice may attack it, ignorance may deride it, but in the end; there it is." -------------------------------------------------- From: "jwcolby" Sent: Thursday, May 29, 2008 12:19 PM To: "Access Developers discussion and problem solving" ; "VBA" ; "Discussion of Hardware and Software issues" Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor > I had a very interesting conversation with my tax guy this > morning. He had previously worked at Lowes Hardware in > their accounting department. > > The upshot of the conversation was that Lowes has to > interface to a huge number of legacy systems, systems from > suppliers, banks, systems from companies they purchased 10 > years ago and inherited etc. His comment of interest is > that in many cases they did not do testing. Or more > correctly they threw data at the live system and looked at > what happened, and then used a feedback loop to work around > to what the system at the other end would accept. > > Sounds like poor Roz at her current assignment. > > I have to tell you that I have experienced this same thing. > My disability insurance call center software has to > interface to about 10 (so far) completely different > insurance companies. Each company has dozens of legacy > systems. > > We get "specs" for how to receive and transmit data to these > mainframe systems. I write code to meet the spec, then we > send data. We then get feedback from them about how to > change the program to meet the "REAL spec" which is never > the printed spec. Iterate until the feedback stops and they > start accepting what we send without complaint. > > In one case they had specified how to output claim data that > they wanted to enter into their system. In this one > (admittedly extreme) case it was in a vertical report > format, which we did. Some six months later we discovered > that the format was designed to allow some key entry person > to key it into their system manually, and the "report order" > was the order that the data entry fields appeared on her screen. > > I got a chuckle out of that one. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi all >> >> A local computer paper brought attention to this work related to >> Daimler-Chrysler but useful in many areas: >> >> http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 >> >> >> This page contains papers on the classification-tree method CTM and the >> classification-tree editor CTE. The classification-tree method is a >> testing method for the systematic design of test cases on basis of the >> specification. The classification-tree editor is a graphical editor >> supporting the application of the classification-tree method. CTM and CTE >> are widely used in industrial practice. >> >> >> The CTE software is free to download and use and the page contains links >> to a bunch of documentation. >> Here's an intro: >> >> http://www.systematic-testing.com/documents/eurostar2000.pdf >> >> >> >> >> > _______________________________________________ > 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 Thu May 29 15:09:34 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 16:09:34 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor In-Reply-To: References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: <483F0D7E.6090905@colbyconsulting.com> > ...I thought that's how everyone does it :) The bigger the company the more likely that is how it is done. John W. Colby www.ColbyConsulting.com William Hindman wrote: > ...I thought that's how everyone does it :) > > William > "The truth is incontrovertible, malice may attack it, ignorance may deride > it, but in the end; there it is." > > -------------------------------------------------- > From: "jwcolby" > Sent: Thursday, May 29, 2008 12:19 PM > To: "Access Developers discussion and problem solving" > ; "VBA" ; > "Discussion of Hardware and Software issues" > Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: > CTEclassification-tree editor > >> I had a very interesting conversation with my tax guy this >> morning. He had previously worked at Lowes Hardware in >> their accounting department. >> >> The upshot of the conversation was that Lowes has to >> interface to a huge number of legacy systems, systems from >> suppliers, banks, systems from companies they purchased 10 >> years ago and inherited etc. His comment of interest is >> that in many cases they did not do testing. Or more >> correctly they threw data at the live system and looked at >> what happened, and then used a feedback loop to work around >> to what the system at the other end would accept. >> >> Sounds like poor Roz at her current assignment. >> >> I have to tell you that I have experienced this same thing. >> My disability insurance call center software has to >> interface to about 10 (so far) completely different >> insurance companies. Each company has dozens of legacy >> systems. >> >> We get "specs" for how to receive and transmit data to these >> mainframe systems. I write code to meet the spec, then we >> send data. We then get feedback from them about how to >> change the program to meet the "REAL spec" which is never >> the printed spec. Iterate until the feedback stops and they >> start accepting what we send without complaint. >> >> In one case they had specified how to output claim data that >> they wanted to enter into their system. In this one >> (admittedly extreme) case it was in a vertical report >> format, which we did. Some six months later we discovered >> that the format was designed to allow some key entry person >> to key it into their system manually, and the "report order" >> was the order that the data entry fields appeared on her screen. >> >> I got a chuckle out of that one. >> >> John W. Colby >> www.ColbyConsulting.com From ebarro at verizon.net Thu May 29 20:25:25 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 29 May 2008 18:25:25 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <483F0D7E.6090905@colbyconsulting.com> References: <483ED7A3.1070206@colbyconsulting.com> <483F0D7E.6090905@colbyconsulting.com> Message-ID: <000001c8c1f4$0b018890$c403000a@advancedinput.com> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 02:21:02 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 09:21:02 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From shamil at smsconsulting.spb.ru Fri May 30 07:45:55 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 16:45:55 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: Message-ID: <000c01c8c253$1a39aa40$6401a8c0@nant> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 09:09:15 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 30 May 2008 15:09:15 +0100 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000c01c8c253$1a39aa40$6401a8c0@nant> References: <000c01c8c253$1a39aa40$6401a8c0@nant> Message-ID: <000201c8c25e$c1073ad0$8119fea9@LTVM> It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 10:42:54 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 19:42:54 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000201c8c25e$c1073ad0$8119fea9@LTVM> Message-ID: <000c01c8c26b$d393d7f0$6401a8c0@nant> Hi Max, Yes, this is why I'm wondering what Gustav means :) BTW, I do use multi-layered approach with a lot of custom classes and mainly ObjectDataSource controls for ASP.NET web forms - works very well but it needs one or another code generation tool: I did develop my own but maybe you'd better purchase existing ones if you do not have time to develop your own... For the task like yours (assuming ObjectDataSource and custom classes are used) I'd batch updates into transactions - that will need some more work than built-in approach you're trying to use but when that custom approach is used ((generated) custom classes + ObjectDataSource control + a few custom coding) then you have control on every bit of your program and you're not dependent on any new technologies MS will develop, and with some more efforts you can have different backends SQL Servers or even MS Access for different customers of the same application etc. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Friday, May 30, 2008 6:09 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Updating dataset from datagrid It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 cfoust at infostatsystems.com Fri May 30 10:50:58 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 May 2008 08:50:58 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000001c8c1f4$0b018890$c403000a@advancedinput.com> References: <483ED7A3.1070206@colbyconsulting.com><483F0D7E.6090905@colbyconsulting.com> <000001c8c1f4$0b018890$c403000a@advancedinput.com> Message-ID: I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 11:32:18 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 18:32:18 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Charlotte and Eric Exactly. It will even write pass-through queries for the asking. /gustav >>> cfoust at infostatsystems.com 30-05-2008 17:50 >>> I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 12:01:04 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 19:01:04 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav From Gustav at cactus.dk Thu May 1 01:28:56 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 08:28:56 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi all This should be doable as Novell claims Mono to be 100% compatible with ASP.NET. A two-page how-to guide is published here: http://novellevents.novell.com/t/5096990/63304383/9281/0/ The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav From wdhindman at dejpolsystems.com Thu May 1 02:24:15 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 1 May 2008 03:24:15 -0400 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux References: Message-ID: ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From pcs.accessd at gmail.com Thu May 1 02:33:10 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 17:33:10 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Message-ID: Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge From shamil at smsconsulting.spb.ru Thu May 1 02:57:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 11:57:15 +0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <4818E198.30501@colbyconsulting.com> Message-ID: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> <<< No matter how you slice it, it has to process more physical disk sectors etc. >>> Hi John, Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' fields but it would be enough to scan index entries, and even maybe non-leaf index pages' entries for the query returning every 1000th row - then the difference I thought between the time to get results from 1+ million rows data table and 90 millions wouldn't be that significant. It's obvious now that that was my wrong assumption because clustered index has actual data rows on its leaf-nodes: Clustered Index http://msdn.microsoft.com/en-us/library/ms177443.aspx Non-Clustered Index http://msdn.microsoft.com/en-us/library/ms177484.aspx New hypothesis based on info on clustered and non-clustered index structure: With *Non-clustered* index defined for your PKID the following query performance should be significantly better. Although I'd not guess now how much time it could take to get this query finished with your db: SELECT RowNum, PKID from ( select Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID from [Names]) s where (s.RowNum % 1000) = 1 union all Select NULL as RowNum, Max(PKID) as PKID from [Names] When there exists a non-clustered index together with clustered for the same field and this field is used in a query as 'order by' or as selection criteria then MS SQL uses non-clustered index as far as I see from query execution plan... Here is how I did create non-clustered index to the test table called [dbo].[Names]: if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] GO CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] ( [PKID] ASC ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO (BTW, did you ever try to create non-clustered indexes on non-PRIMARY filegroups of an MS SQL 2000/2005 database? - another tip, which could improve query performance, especially if to keep indexes' filegroups on different HDDs - and the latter could be not backed-up because indexes can be rebuilt anytime, and building non-clustered indexes should be non that time consuming even for 90 million records DB? ) Please feel free to check or ignore the new hypothesis with your 90 million db table... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 1:16 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] vb.net - Updates I do have the clustered stuff exactly as you show: > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > IGNORE_DUP_KEY = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > ) ON [PRIMARY] Likewise I am getting the same 99% cost clustered index scan. I have to guess it is something else. There is a lot of empty space in the database file which I will compact out tonight. It takes hours because of the size and when it is doing that I cannot use the db. Perhaps I have severe fragmentation or something. The database size is 300 GIGS. And finally just remember that when all is said and done it is still a hundred times larger than your database. No matter how you slice it, it has to process more physical disk sectors etc. John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu May 1 03:05:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 12:05:40 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: Message-ID: <034201c8ab62$25a2cc70$6401a8c0@nant> Hi Borge, Just remove these lines, which do not compile - those are attributes used internally by VB6: VBA has some similar attributes but you usually do not need to change them from within VBA's IDE.... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen Sent: Thursday, May 01, 2008 11:33 AM To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Hi there, I am swimming in the deep end of the pool and threading water so to speak .... I need help! I have imported a VB6 .cls file into VBA The following shows up in red and will not compile 'Will not compile : VERSION 1.0 CLASS Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True 'End of lines not compiling Here is the beginning of the module - it's the HTTPClass.cls from available from some VB6 website, can't remember the link right now ...; all other code lines appear ok in VBA What do I need to do?? '**** Beginning of VBA Class Module :: Option Compare Database Option Explicit VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject End Attribute VB_Name = "HTTPClass" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Public Enum ePort INTERNET_DEFAULT_HTTP_PORT = 80 INTERNET_DEFAULT_HTTPS_PORT = 443 End Enum ... Regards borge _______________________________________________ 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 Thu May 1 03:14:43 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 01 May 2008 10:14:43 +0200 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux Message-ID: Hi William No don't. The article is about the _server_ side! /gustav >>> wdhindman at dejpolsystems.com 01-05-2008 09:24 >>> ...lots of things "should" be doable ...but one of them isn't giving up vs2008 just so I can run linux instead of windows ...linux is going to have to get a whole lot better first. William -------------------------------------------------- From: "Gustav Brock" Sent: Thursday, May 01, 2008 2:28 AM To: " Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux > Hi all > > This should be doable as Novell claims Mono to be 100% compatible with > ASP.NET. > A two-page how-to guide is published here: > > http://novellevents.novell.com/t/5096990/63304383/9281/0/ > > > The Novell implementation of ASP.NET is part of the Mono project, and is a > standard component of our SUSE Linux Enterprise offerings and OpenSUSE > Linux distribution. > By offering this 100 percent-compatible implementation of ASP.NET, we have > opened a whole new world for developers. > > > /gustav From jwcolby at colbyconsulting.com Thu May 1 06:10:13 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 07:10:13 -0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <034201c8ab62$25a2cc70$6401a8c0@nant> References: <034201c8ab62$25a2cc70$6401a8c0@nant> Message-ID: <4819A515.9080300@colbyconsulting.com> Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 Thu May 1 06:27:39 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 1 May 2008 15:27:39 +0400 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <4819A515.9080300@colbyconsulting.com> Message-ID: <036d01c8ab7e$5d8845e0$6401a8c0@nant> John, May I argue that Borge just needs to get VB6 code reused (copied and pasted) in his VBA project? Let's ask Borge? Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 3:10 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA Shamil, If you notice the Exposed and creatable properties, it appears that he is trying to make the class viewable from outside of a library. Just deleting those lines will prevent that. He needs to do the Insert Class, Insert file thing. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi Borge, > > Just remove these lines, which do not compile - those are attributes used > internally by VB6: VBA has some similar attributes but you usually do not > need to change them from within VBA's IDE.... > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > Sent: Thursday, May 01, 2008 11:33 AM > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Hi there, > > I am swimming in the deep end of the pool and threading water so to speak > .... I need help! > > I have imported a VB6 .cls file into VBA > > The following shows up in red and will not compile > > 'Will not compile : > VERSION 1.0 CLASS > > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > 'End of lines not compiling > > Here is the beginning of the module - it's the HTTPClass.cls from available > from some VB6 website, can't remember the link right now ...; > all other code lines appear ok in VBA > > What do I need to do?? > > > > '**** Beginning of VBA Class Module :: > Option Compare Database > Option Explicit > VERSION 1.0 CLASS > BEGIN > MultiUse = -1 'True > Persistable = 0 'NotPersistable > DataBindingBehavior = 0 'vbNone > DataSourceBehavior = 0 'vbNone > MTSTransactionMode = 0 'NotAnMTSObject > End > Attribute VB_Name = "HTTPClass" > Attribute VB_GlobalNameSpace = False > Attribute VB_Creatable = True > Attribute VB_PredeclaredId = False > Attribute VB_Exposed = True > > Public Enum ePort > INTERNET_DEFAULT_HTTP_PORT = 80 > INTERNET_DEFAULT_HTTPS_PORT = 443 > End Enum > ... > > > Regards > borge > _______________________________________________ > 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 pcs.accessd at gmail.com Thu May 1 07:08:11 2008 From: pcs.accessd at gmail.com (Borge Hansen) Date: Thu, 1 May 2008 22:08:11 +1000 Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA In-Reply-To: <036d01c8ab7e$5d8845e0$6401a8c0@nant> References: <4819A515.9080300@colbyconsulting.com> <036d01c8ab7e$5d8845e0$6401a8c0@nant> Message-ID: Hi guys, I was going to just say please disregard my post... But this is what happened: I have this HTTPClass.cls from http://www.paradoxes.info/code/HTTPClass.html We are using it to send data across the internet to a service provider who does Text To Speech (TTS) for us, then sends out phone calls, receives the keys press feed back from the clients - which in turn is sent back to us via another process ... used for identifying short term relief staff to fill short term vacancies in different industries .... So far I had been using the properties from a .dll created on the class and referenced into the VBA project. Questions came up about the format of the parameters we are sending across, so I had to start look into this thing and pick out the string that is actually being sent. So I thought I try and import the .cls into a class module and run the class in the VBA project so I can debug.print the POSTDATA string of the SendRequest function... (see the code on the website...) To answer your question: I did Insert > ClassModule > Pasted the Code from HTTPSClass.cls > Compiled Code > Saved the Class Module No problems! What prompted my question was that I had opened the .cls file in VisualStudio and it had added the Version and Attribute lines I was having problem with - which turns out is not part of the original .cls file and is totally unnecessary .. John and Shamil, thanks for responding... regards borge On Thu, May 1, 2008 at 9:27 PM, Shamil Salakhetdinov < shamil at smsconsulting.spb.ru> wrote: > John, > > May I argue that Borge just needs to get VB6 code reused (copied and > pasted) > in his VBA project? Let's ask Borge? > > Thanks. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 3:10 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > Shamil, > > If you notice the Exposed and creatable properties, it appears that he > is trying to make the class viewable from outside of a library. Just > deleting those lines will prevent that. > > He needs to do the Insert Class, Insert file thing. > > John W. Colby > www.ColbyConsulting.com > > > Shamil Salakhetdinov wrote: > > Hi Borge, > > > > Just remove these lines, which do not compile - those are attributes > used > > internally by VB6: VBA has some similar attributes but you usually do > not > > need to change them from within VBA's IDE.... > > > > -- > > Shamil > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen > > Sent: Thursday, May 01, 2008 11:33 AM > > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com > > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA > > > > Hi there, > > > > I am swimming in the deep end of the pool and threading water so to > speak > > .... I need help! > > > > I have imported a VB6 .cls file into VBA > > > > The following shows up in red and will not compile > > > > 'Will not compile : > > VERSION 1.0 CLASS > > > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > 'End of lines not compiling > > > > Here is the beginning of the module - it's the HTTPClass.cls from > available > > from some VB6 website, can't remember the link right now ...; > > all other code lines appear ok in VBA > > > > What do I need to do?? > > > > > > > > '**** Beginning of VBA Class Module :: > > Option Compare Database > > Option Explicit > > VERSION 1.0 CLASS > > BEGIN > > MultiUse = -1 'True > > Persistable = 0 'NotPersistable > > DataBindingBehavior = 0 'vbNone > > DataSourceBehavior = 0 'vbNone > > MTSTransactionMode = 0 'NotAnMTSObject > > End > > Attribute VB_Name = "HTTPClass" > > Attribute VB_GlobalNameSpace = False > > Attribute VB_Creatable = True > > Attribute VB_PredeclaredId = False > > Attribute VB_Exposed = True > > > > Public Enum ePort > > INTERNET_DEFAULT_HTTP_PORT = 80 > > INTERNET_DEFAULT_HTTPS_PORT = 443 > > End Enum > > ... > > > > > > Regards > > borge > > _______________________________________________ > > 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 Thu May 1 07:10:05 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:10:05 -0400 Subject: [dba-VB] vb.net - Updates In-Reply-To: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> References: <033b01c8ab60$f8a6a4e0$6401a8c0@nant> Message-ID: <4819B31D.2060706@colbyconsulting.com> I have many indexes set up which include the PKID and one or more other fields. One would think that the optimizer would use one of those indexes instead of the clustered PKID index. I am thinking that a hint is in order to force SQL Server to use a different index. That is beyond my expertise however. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > <<< > No matter how you slice it, it has to process > more physical disk sectors etc. > Hi John, > > Yes, but I thought MS SQL wouldn't need to scan the values of all data rows' > fields but it would be enough to scan index entries, and even maybe non-leaf > index pages' entries for the query returning every 1000th row - then the > difference I thought between the time to get results from 1+ million rows > data table and 90 millions wouldn't be that significant. It's obvious now > that that was my wrong assumption because clustered index has actual data > rows on its leaf-nodes: > > Clustered Index > http://msdn.microsoft.com/en-us/library/ms177443.aspx > > Non-Clustered Index > http://msdn.microsoft.com/en-us/library/ms177484.aspx > > > New hypothesis based on info on clustered and non-clustered index structure: > With *Non-clustered* index defined for your PKID the following query > performance should be significantly better. Although I'd not guess now how > much time it could take to get this query finished with your db: > > SELECT RowNum, PKID from ( select > Cast(ROW_NUMBER() over (ORDER BY [PKID]) as int) as RowNum, PKID > from [Names]) s > where (s.RowNum % 1000) = 1 > union all > Select NULL as RowNum, Max(PKID) as PKID from [Names] > > When there exists a non-clustered index together with clustered for the same > field and this field is used in a query as 'order by' or as selection > criteria then MS SQL uses non-clustered index as far as I see from query > execution plan... > > Here is how I did create non-clustered index to the test table called > [dbo].[Names]: > > if exists (select * from dbo.sysindexes where name = 'ALT_KEY_NamesParser') > DROP INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > GO > > CREATE UNIQUE NONCLUSTERED INDEX [ALT_KEY_NamesParser] ON [dbo].[Names] > ( > [PKID] ASC > ) > WITH (PAD_INDEX = OFF, > STATISTICS_NORECOMPUTE = OFF, > SORT_IN_TEMPDB = OFF, > IGNORE_DUP_KEY = OFF, > DROP_EXISTING = OFF, > ONLINE = OFF, > ALLOW_ROW_LOCKS = ON, > ALLOW_PAGE_LOCKS = ON) > ON [PRIMARY] > GO > > (BTW, did you ever try to create non-clustered indexes on non-PRIMARY > filegroups of an MS SQL 2000/2005 database? - another tip, which could > improve query performance, especially if to keep indexes' filegroups on > different HDDs - and the latter could be not backed-up because indexes can > be rebuilt anytime, and building non-clustered indexes should be non that > time consuming even for 90 million records DB? ) > > Please feel free to check or ignore the new hypothesis with your 90 million > db table... > > Thank you. > > -- > Shamil > > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, May 01, 2008 1:16 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] vb.net - Updates > > I do have the clustered stuff exactly as you show: > > > CONSTRAINT [PK_Names] PRIMARY KEY CLUSTERED > > ( > > [PKID] ASC > > ) > > WITH (PAD_INDEX = OFF, > > STATISTICS_NORECOMPUTE = OFF, > > IGNORE_DUP_KEY = OFF, > > ALLOW_ROW_LOCKS = ON, > > ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] > > ) ON [PRIMARY] > > Likewise I am getting the same 99% cost clustered index scan. > > I have to guess it is something else. There is a lot of empty space in > the database file which I will compact out tonight. It takes hours > because of the size and when it is doing that I cannot use the db. > Perhaps I have severe fragmentation or something. The database size is > 300 GIGS. And finally just remember that when all is said and done it > is still a hundred times larger than your database. No matter how you > slice it, it has to process more physical disk sectors etc. > > 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 jwcolby at colbyconsulting.com Thu May 1 07:37:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 08:37:44 -0400 Subject: [dba-VB] System not responding for seconds at a time Message-ID: <4819B998.40507@colbyconsulting.com> I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Thu May 1 08:28:46 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 01 May 2008 06:28:46 -0700 Subject: [dba-VB] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> Message-ID: <0K0600GA3YRY8146@vms173001.mailsrvcs.net> John, Try Process Explorer from SysInternals. It shows everything that's running on your machine. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx And yes SQL server does in fact take up a lot of memory when shrinking files. I would stop the sql server and the sql server agent using Services in Control Panel->Admin Tools but make sure it is not writing to the disk first. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, May 01, 2008 5:38 AM To: Discussion of Hardware and Software issues; VBA; Dba-Sqlserver Subject: [dba-VB] System not responding for seconds at a time I don't quite know where to address this so I am cross posting it. I am working on a fairly powerful server running Windows 2003 x64 and SQL Server 2003 x64. It has 8 gigs of memory. No malware software, software firewall, virus scanner etc. Nothing. I am running a file shrink on the SQL Server file, trying to remove about 140 gigs of empty space. That process has been running since last night, well over 8 hours now. It APPEARS that process is using all of available memory since task manager shows only about 200 megs "available". However if you look at the process tab, no process says it is using more than 100 megs of ram. The performance tab shows almost no CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then only one of the cores appears to be doing anything. The computer is "stuttering" badly. Try to do anything - change to a different program, page up in visual studios code etc, and the computer will usually hesitate before doing whatever you requested. I am trying to work on a VB project and can't get anything done because as I move around in the doc it may take 2 to 5 seconds just to respond to my request to move my cursor. Has anyone seen SQL Server lock up the the system like this, IOW is it SQL Server? Does anyone know how long the file shrink could take - days, weeks, months? Does anyone know how to cancel the file shrink? This is the most powerful server I have, quad core, running x64 software, 8 gigs, high speed raid arrays etc. Unfortunately I was in the middle of a vb.net project yesterday before I started the shrink running after work and the server is unusable for anything right now. -- 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 jwcolby at colbyconsulting.com Thu May 1 08:30:44 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 01 May 2008 09:30:44 -0400 Subject: [dba-VB] [dba-SQLServer] System not responding for seconds at a time In-Reply-To: <4819B998.40507@colbyconsulting.com> References: <4819B998.40507@colbyconsulting.com> Message-ID: <4819C604.4000901@colbyconsulting.com> Well... it appears that I have fixed the issue. After Googling "slow server response time" or something similar I ran across references to a "Maximum Memory" property for SQL Server. I finally found that and it was set to something insane like 200000000 MEGABYTES (several petabytes of server memory). While I can dream of such a machine, it ain't happening here! I adjusted the Maximum Memory down to 2 gigs and the "amount available" in Task Manager Performance tab popped up to 4 gigs. Having done that, and after perhaps 30 seconds, suddenly my machine is responding in a normal way. I am now adjusting that number to "leave" perhaps 2 gigs available to applications other than SQL Server. I probably don't even need 2 gigs but it is critical that I don't end up unable to do anything on that machine. John W. Colby www.ColbyConsulting.com jwcolby wrote: > I don't quite know where to address this so I am cross posting it. I am > working on a fairly powerful server running Windows 2003 x64 and SQL > Server 2003 x64. It has 8 gigs of memory. No malware software, > software firewall, virus scanner etc. Nothing. > > I am running a file shrink on the SQL Server file, trying to remove > about 140 gigs of empty space. That process has been running since last > night, well over 8 hours now. It APPEARS that process is using all of > available memory since task manager shows only about 200 megs > "available". However if you look at the process tab, no process says it > is using more than 100 megs of ram. The performance tab shows almost no > CPU cycles used, 4 cores hanging out about 0 - 10% used, and even then > only one of the cores appears to be doing anything. > > The computer is "stuttering" badly. Try to do anything - change to a > different program, page up in visual studios code etc, and the computer > will usually hesitate before doing whatever you requested. I am trying > to work on a VB project and can't get anything done because as I move > around in the doc it may take 2 to 5 seconds just to respond to my > request to move my cursor. > > Has anyone seen SQL Server lock up the the system like this, IOW is it > SQL Server? Does anyone know how long the file shrink could take - > days, weeks, months? Does anyone know how to cancel the file shrink? > This is the most powerful server I have, quad core, running x64 > software, 8 gigs, high speed raid arrays etc. > > Unfortunately I was in the middle of a vb.net project yesterday before I > started the shrink running after work and the server is unusable for > anything right now. > From accessd at shaw.ca Thu May 1 18:27:16 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 01 May 2008 16:27:16 -0700 Subject: [dba-VB] Porting Your ASP.NET 2.0 Applications from Windows to Linux In-Reply-To: References: Message-ID: <803E0A4449764EF0AE3F013A4B9443AF@creativesystemdesigns.com> That is stellar news Gustav. Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, April 30, 2008 11:29 PM To: The Novell implementation of ASP.NET is part of the Mono project, and is a standard component of our SUSE Linux Enterprise offerings and OpenSUSE Linux distribution. By offering this 100 percent-compatible implementation of ASP.NET, we have opened a whole new world for developers. /gustav _______________________________________________ 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 May 2 06:00:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:00:19 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... Message-ID: <044901c8ac43$b6314e10$6401a8c0@nant> Hi All, Anybody lucky here to manage to find where to download "Classifieds Web Site Starter Kit"? The link on its web site hosted by MS http://www.asp.net/downloads/starter-kits/classifieds/ seems to be brokwen as well as on some other sites, which all refer this broken link. Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 06:08:42 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 07:08:42 -0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... References: <044901c8ac43$b6314e10$6401a8c0@nant> Message-ID: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 06:38:20 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 15:38:20 +0400 Subject: [dba-VB] Classifieds Web Site Starter Kit Download... In-Reply-To: <002b01c8ac44$e2deb960$0502a8c0@Laptop> Message-ID: <045001c8ac49$083bb560$6401a8c0@nant> Thank you, Michael! Yes, discountasp.net has a link, which leads to correct "Classifieds Web Site Starter Kit Download": http://download.microsoft.com/download/e/d/d/edd838dc-d369-403f-a5e0-d1ca2b5 be0be/class.vsi -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys Sent: Friday, May 02, 2008 3:09 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Classifieds Web Site Starter Kit Download... Hi Shamil, I found it here: http://www.discountasp.net/sp_aspnetstarterkithosting_classified.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 7:00 AM Subject: [dba-VB] Classifieds Web Site Starter Kit Download... > > Hi All, > > Anybody lucky here to manage to find where to download "Classifieds Web > Site > Starter Kit"? > > The link on its web site hosted by MS > > http://www.asp.net/downloads/starter-kits/classifieds/ > > seems to be brokwen as well as on some other sites, which all refer this > broken link. > > Thank you. > > -- > Shamil > > > _______________________________________________ > 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 May 2 08:53:11 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 2 May 2008 17:53:11 +0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial on CodeProject Message-ID: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Hi All, I have found the following article as a good source on WinForms databinding with custom classes: A Detailed WinForns Data Binding Tutorial http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx Was it mentioned here already? Thank you. -- Shamil From mmattys at rochester.rr.com Fri May 2 10:31:28 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Fri, 2 May 2008 11:31:28 -0400 Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject References: <046a01c8ac5b$dc8dc8a0$6401a8c0@nant> Message-ID: <00ce01c8ac69$9825b250$0502a8c0@Laptop> Hi Shamil, No, I hadn't seen this before. Thank you! Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Shamil Salakhetdinov" To: "'Access-D - VB'" Sent: Friday, May 02, 2008 9:53 AM Subject: [dba-VB] FYI: A Detailed WinForns Data Binding Tutorial onCodeProject > Hi All, > > I have found the following article as a good source on WinForms > databinding > with custom classes: > > A Detailed WinForns Data Binding Tutorial > > http://www.codeproject.com/KB/miscctrl/databinding_tutorial.aspx > > Was it mentioned here already? > > Thank you. > > -- > Shamil > > _______________________________________________ > 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 May 2 12:35:52 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:35:52 -0400 Subject: [dba-VB] Visual Studio 2008 Message-ID: <481B50F8.5020202@colbyconsulting.com> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 2 12:43:58 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 02 May 2008 19:43:58 +0200 Subject: [dba-VB] Visual Studio 2008 Message-ID: Hi John I have both installed. Only task on Vista was to download and install a large update for VS2005 which it announces when the initial install has finished. /gustav >>> jwcolby at colbyconsulting.com 02-05-2008 19:35 >>> Can VS2008 co-habitate with 2005? Andything special I need to do? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri May 2 12:47:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 02 May 2008 13:47:26 -0400 Subject: [dba-VB] Visual Studio 2008 In-Reply-To: <481B50F8.5020202@colbyconsulting.com> References: <481B50F8.5020202@colbyconsulting.com> Message-ID: <481B53AE.4080802@colbyconsulting.com> Other than learn how to spell? ;-) John W. Colby www.ColbyConsulting.com jwcolby wrote: > Can VS2008 co-habitate with 2005? Andything special I need to do? > From Gustav at cactus.dk Sun May 4 02:23:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 09:23:53 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi all What do you use as feed for the Start Page? If any? I noticed that neither in VS2005 nor VS2008 the Start Page has been updated since the initial install. In VS2008 this URL is created: http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 It links to: http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml which has a last entry of Mar. 20th. That explains. But why does VS install this? I located via Google another feed: http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml which seems to update. But that is not C#. /gustav From wdhindman at dejpolsystems.com Sun May 4 02:45:49 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Sun, 4 May 2008 03:45:49 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <4E8801746B1B499B88AD78BD3B3E542F@jislaptopdev> ...nice find Gustav ...I'd just eliminated the start page altogether ...I'll have to give this a shot :) William -------------------------------------------------- From: "Gustav Brock" Sent: Sunday, May 04, 2008 3:23 AM To: " Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From mmattys at rochester.rr.com Sun May 4 06:53:16 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 07:53:16 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <002501c8addd$71922540$0502a8c0@Laptop> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /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 Sun May 4 07:01:35 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 04 May 2008 08:01:35 -0400 Subject: [dba-VB] SQL Server timeouts Message-ID: <481DA59F.5060503@colbyconsulting.com> I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- John W. Colby www.ColbyConsulting.com From mmattys at rochester.rr.com Sun May 4 07:46:05 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 08:46:05 -0400 Subject: [dba-VB] SQL Server timeouts References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <005401c8ade4$d20375d0$0502a8c0@Laptop> While I was on Amazon a few days ago, the key word "Tuning" caught my eye - - so I looked it up. This might help, but do Google: http://www.codeproject.com/KB/database/sql-tuning-tutorial-1.aspx Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" To: "VBA" ; "Dba-Sqlserver" Sent: Sunday, May 04, 2008 8:01 AM Subject: [dba-VB] SQL Server timeouts >I am running this process that updates SQL Server from VB.Net. The > process runs normally for tens of millions of records, then SQL Server > "hangs" and stops servicing requests (from this process), either reads > or writes. It just times out with error messages "Timeout Expired: The > timeout period expired prior to completion of the operation or SQL > Server is not responding". > > This is not a once off occurrence, it happens every time I start the > process running. Sometimes I get this and then eventually SQL Server > will start responding, sometimes it just stops responding. > > How do I troubleshoot this? > -- > 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 mikedorism at verizon.net Sun May 4 08:07:01 2008 From: mikedorism at verizon.net (Doris Manning) Date: Sun, 04 May 2008 09:07:01 -0400 Subject: [dba-VB] SQL Server timeouts In-Reply-To: <481DA59F.5060503@colbyconsulting.com> References: <481DA59F.5060503@colbyconsulting.com> Message-ID: <000901c8ade7$be7d6a40$2d01a8c0@Kermit> The culprit is probably a system database called "tempdb". This database gets reset each time you stop and restart SQL Server. In my world, I had to create a job to shrink it every hour in order to resolve this issue. http://sqlserver2000.databases.aspfaq.com/why-is-tempdb-full-and-how-can-i-p revent-this-from-happening.html Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, May 04, 2008 8:02 AM To: VBA; Dba-Sqlserver Subject: [dba-VB] SQL Server timeouts I am running this process that updates SQL Server from VB.Net. The process runs normally for tens of millions of records, then SQL Server "hangs" and stops servicing requests (from this process), either reads or writes. It just times out with error messages "Timeout Expired: The timeout period expired prior to completion of the operation or SQL Server is not responding". This is not a once off occurrence, it happens every time I start the process running. Sometimes I get this and then eventually SQL Server will start responding, sometimes it just stops responding. How do I troubleshoot this? -- 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 Gustav at cactus.dk Sun May 4 08:39:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 04 May 2008 15:39:07 +0200 Subject: [dba-VB] VS Start Page feed Message-ID: Hi Michael Some typos here? Should be, I guess: http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 Links to: http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml /gustav >>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> Mine says: (Last update Fri., May 2) http://go.microsoft.com/flink/?linkid45191&clcid=409 Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: " Sent: Sunday, May 04, 2008 3:23 AM Subject: [dba-VB] VS Start Page feed > Hi all > > What do you use as feed for the Start Page? If any? > > I noticed that neither in VS2005 nor VS2008 the Start Page has been > updated since the initial install. > In VS2008 this URL is created: > > http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 > > It links to: > > http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml > > which has a last entry of Mar. 20th. > That explains. But why does VS install this? > > I located via Google another feed: > > http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml > > which seems to update. But that is not C#. > > /gustav From mmattys at rochester.rr.com Sun May 4 09:30:11 2008 From: mmattys at rochester.rr.com (Michael R Mattys) Date: Sun, 4 May 2008 10:30:11 -0400 Subject: [dba-VB] VS Start Page feed References: Message-ID: <006801c8adf3$5cf9c4b0$0502a8c0@Laptop> Sorry, working from two laptops ... one connected, one protected. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "Gustav Brock" To: Sent: Sunday, May 04, 2008 9:39 AM Subject: Re: [dba-VB] VS Start Page feed > Hi Michael > > Some typos here? Should be, I guess: > http://go.microsoft.com/fwlink/?linkid=45191&clcid=409 > > Links to: > http://www.microsoft.com/feeds/msdn/en-us/express/expressvcs.xml > > /gustav > >>>> mmattys at rochester.rr.com 04-05-2008 13:53 >>> > Mine says: > > (Last update Fri., May 2) > http://go.microsoft.com/flink/?linkid45191&clcid=409 > > Michael R. Mattys > MapPoint & Access Dev > www.mattysconsulting.com > > ----- Original Message ----- > From: "Gustav Brock" > To: " > Sent: Sunday, May 04, 2008 3:23 AM > Subject: [dba-VB] VS Start Page feed > > >> Hi all >> >> What do you use as feed for the Start Page? If any? >> >> I noticed that neither in VS2005 nor VS2008 the Start Page has been >> updated since the initial install. >> In VS2008 this URL is created: >> >> http://go.microsoft.com/fwlink/?linkid=84795&clcid=409 >> >> It links to: >> >> http://www.microsoft.com/feeds/msdn/en-us/vcsharp/vcsharp_en_us.xml >> >> which has a last entry of Mar. 20th. >> That explains. But why does VS install this? >> >> I located via Google another feed: >> >> http://www.microsoft.com/feeds/msdn/en-us/vstudio/rss.xml >> >> which seems to update. But that is not C#. >> >> /gustav > > > > _______________________________________________ > 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 May 5 08:03:23 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 17:03:23 +0400 Subject: [dba-VB] FYI: Programming ftp in .NET Message-ID: <05ed01c8aeb0$68210250$6401a8c0@nant> Hi All, It happens that basic FTP access - login, change dir, upload and download can be relatively easy programmed by using this free code - http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm ... I have found just one issue: while uploading a file having left or right curly bracket - '{' or '}' in ASCII mode I'm getting "Input line wasn't in correct format" runtime error on this code line: public class FTPClient ... private void PutASCII(Stream srcStream, string remoteFile, bool append) ... writer.Write(line, 0, line.Length); ... When I make curly bracket duplicated then it works well, but then download doesn't work again breaking on curly bracket... Have you seen issues like that? (I guess I have here FTP protocol specs violation in the case of curly brackets?) In BINARY mode everything seems to work well, therefore issue isn't that critical still I'd be interested to know what other chars could result in runtime errors? And how to properly escape curly brackets to implement FTP put and get in ASCII mode.... BTW, in P.S. you can find simple C# Windows Console app FTP test of the referred above free source Thanks. -- Shamil P.S. using System; using System.Collections.Generic; using System.Text; using com.enterprisedt.net.ftp; using FTP; namespace FTPTestConsole { class Program { private static void logger_OnLoggableEvent(object o, LogInfoEventArgs e) { //lbProgress.Items.Add(e.Message); //lbProgress.SelectedIndex = lbProgress.Items.Count - 1; //Application.DoEvents(); Console.WriteLine(e.Message); } private static string _host = "{{yourHostHere}}"; private static string _userId = "{{yourUserNameHere}}"; private static string _password = "{{yourPasswordHere}}"; private static string _ftpFolder = "testUp"; private static string _localUploadedFileFullPath = @"E:\temp\up.txt"; private static string _localDownloadedFileFullPath = @"E:\temp\OK.txt"; private static string _remoteFileName = "test.txt"; static void Main(string[] args) { try { // Create and register a logger FTP.Logger logger = new FTP.Logger(); //logger.OnLoggableEvent += new FTP.Logger.LoggableEventHandler(logger_OnLoggableEvent); logger.OnLoggableEvent += new Logger.LoggableEventHandler(logger_OnLoggableEvent); // create an instance of FTPClient, passing in the name of hte host, the time out // and the logger for updates string host = _host; com.enterprisedt.net.ftp.FTPClient ftpClient = new com.enterprisedt.net.ftp.FTPClient(host); // call login, passing in the user id and the password string user = _userId; string pw = _password; ftpClient.Login(user, pw); // change directory on the host logger.Write(null, "Client requesting change directory to " + _ftpFolder); string newDirectory = _ftpFolder; ftpClient.Chdir(newDirectory); // send a file to the host (rename it there) logger.Write(null, "Client calling Put(" + _localUploadedFileFullPath + "," + _remoteFileName + ")"); string localFileName = _localUploadedFileFullPath; string remoteFileName = _remoteFileName; //ftpClient.Put(localFileName, remoteFileName); ftpClient.TransferType = FTPTransferType.BINARY; ftpClient.Put(localFileName, remoteFileName); // ge the file back from the host, rename it here logger.Write(null, "Client calling Get(" + _localDownloadedFileFullPath + "," + _remoteFileName + ")"); string newFileName = _localDownloadedFileFullPath; ftpClient.Get(newFileName, remoteFileName); // clean up and go home logger.Write(null, "Client calling quit"); ftpClient.Quit(); logger.Write(null, "Done."); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } } From jwcolby at colbyconsulting.com Mon May 5 08:06:01 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 09:06:01 -0400 Subject: [dba-VB] SQL Server WHERE Clause order Message-ID: <481F0639.2090300@colbyconsulting.com> Does it make any difference in SQL Server the order of the WHERE clause items. For example: WHERE (LastName IS NOT NULL) AND (AGE > 30) vs WHERE (AGE > 30) AND (LastName IS NOT NULL) -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:23:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:23:26 -0400 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: <481F266E.9020104@colbyconsulting.com> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:41:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:41:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F2AAB.7060109@colbyconsulting.com> When I type ?string.format("yyyyMMdd",Date.Today) into the debug window I get yyyyMMdd (the literal string) not 20080505. What am I doing wrong? John W. Colby www.ColbyConsulting.com jwcolby wrote: > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 10:43:08 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 19:43:08 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> Message-ID: <061d01c8aec6$b73dafd0$6401a8c0@nant> Hi John, This should be it: Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) Console.WriteLine(dt) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:23 PM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 mikedorism at verizon.net Mon May 5 10:46:24 2008 From: mikedorism at verizon.net (Doris Manning) Date: Mon, 05 May 2008 11:46:24 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <000601c8aec7$2cc87a00$2d01a8c0@Kermit> JC, Try using... Format(Date.Now, "yyyyMMdd-hhmmss") Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 11:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Gustav at cactus.dk Mon May 5 10:51:41 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 05 May 2008 17:51:41 +0200 Subject: [dba-VB] VB.Net Date/time in specific format Message-ID: Hi John Here's a good reference on date format strings with lots of samples: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx /gustav >>> jwcolby at colbyconsulting.com 05-05-2008 17:23 >>> I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon May 5 10:59:03 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 11:59:03 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <061d01c8aec6$b73dafd0$6401a8c0@nant> References: <061d01c8aec6$b73dafd0$6401a8c0@nant> Message-ID: <481F2EC7.8020700@colbyconsulting.com> Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > From shamil at smsconsulting.spb.ru Mon May 5 11:17:13 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 5 May 2008 20:17:13 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <062401c8aecb$7a495700$6401a8c0@nant> OK - DateTime.Now.ToString("yyyyMMdd-hhmmss") should work well also. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Mon May 5 11:40:43 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 5 May 2008 09:40:43 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: <003801c8aece$c32188f0$0200a8c0@murphy3234aaf1> Hi John, I have an app that does something similar with wav files. What I use to time stamp the files is to use the time as the file name as follows. sFileName = sFolder & CStr(DatePart("h", Now)) & "_" & CStr(DatePart("n", Now)) & "_" & CStr(DatePart("s", Now)) & ".wav" May not be elegant but it works. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- 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 Mon May 5 11:46:42 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Mon, 5 May 2008 09:46:42 -0700 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F266E.9020104@colbyconsulting.com> References: <481F266E.9020104@colbyconsulting.com> Message-ID: I would strongly suggest you use an underscore rather than a hyphen in your file name. We've encountered various situations where the hyphen is treated as an invalid character, particularly when transferring files electronically. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 8:23 AM To: VBA Subject: [dba-VB] VB.Net Date/time in specific format I need to get the current date / time in a format that does not include : or /, IOW "20030123-082347". I need it in this format for appending to a file name so that the name is unique and sorts in the directory. Has anyone already done this, or know how it is done? I can get the year part etc., but I am not finding hour, minute or second, and I am just wondering if someone has code already built. -- John W. Colby www.ColbyConsulting.com _______________________________________________ From jwcolby at colbyconsulting.com Mon May 5 12:07:37 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 05 May 2008 13:07:37 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: References: <481F266E.9020104@colbyconsulting.com> Message-ID: <481F3ED9.9020100@colbyconsulting.com> I can do that. Thanks. John W. Colby www.ColbyConsulting.com Charlotte Foust wrote: > I would strongly suggest you use an underscore rather than a hyphen in > your file name. We've encountered various situations where the hyphen > is treated as an invalid character, particularly when transferring files > electronically. > > Charlotte Foust > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 8:23 AM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > > -- > 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 jwcolby at colbyconsulting.com Tue May 6 15:50:18 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 06 May 2008 16:50:18 -0400 Subject: [dba-VB] SP1 - how do you tell Message-ID: <4820C48A.4060406@colbyconsulting.com> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Tue May 6 16:00:07 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 06 May 2008 23:00:07 +0200 Subject: [dba-VB] SP1 - how do you tell Message-ID: Hi John Mine tells: Version 8.0.50727.867 (vvista.050727-8600) /gustav >>> jwcolby at colbyconsulting.com 06-05-2008 22:50 >>> I applied SP1. How do I determine that Visual Studio has SP1 applied? The Framework says it's SP1 but the VS itself says SP .05xxxxxxxxx -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed May 7 06:53:15 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 7 May 2008 15:53:15 +0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <481F2EC7.8020700@colbyconsulting.com> Message-ID: <07c101c8b038$ef88b470$6401a8c0@nant> Hi John, Please make correction to your string formatting: Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) Console.WriteLine(dt) IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the hour value in 00 - 11 range, and you might get file names collisions: yes, very low probability to get such collisions but "Murphy Laws" are waiting us, developers, around every corner, you know, and we have to be very accurate, and a little bit "paranoid"... Thanks. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, May 05, 2008 7:59 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] VB.Net Date/time in specific format Thanks, worked perfectly. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > This should be it: > > Dim dt as String = string.Format("{0:yyyyMMdd-hhmmss}", DateTime.Now) > Console.WriteLine(dt) > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, May 05, 2008 7:23 PM > To: VBA > Subject: [dba-VB] VB.Net Date/time in specific format > > I need to get the current date / time in a format that does not include > : or /, IOW "20030123-082347". I need it in this format for appending > to a file name so that the name is unique and sorts in the directory. > > Has anyone already done this, or know how it is done? I can get the > year part etc., but I am not finding hour, minute or second, and I am > just wondering if someone has code already built. > _______________________________________________ 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 May 7 07:05:31 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 07 May 2008 08:05:31 -0400 Subject: [dba-VB] VB.Net Date/time in specific format In-Reply-To: <07c101c8b038$ef88b470$6401a8c0@nant> References: <07c101c8b038$ef88b470$6401a8c0@nant> Message-ID: <48219B0B.7040901@colbyconsulting.com> Thanks for that Shamil. John W. Colby www.ColbyConsulting.com Shamil Salakhetdinov wrote: > Hi John, > > Please make correction to your string formatting: > > Dim dt as String = string.Format("{0:yyyyMMdd_HHmmss}", DateTime.Now) > Console.WriteLine(dt) > > IOW, use uppercase 'HH' instead of lowercase 'hh' - the latter gives the > hour value in 00 - 11 range, and you might get file names collisions: yes, > very low probability to get such collisions but "Murphy Laws" are waiting > us, developers, around every corner, you know, and we have to be very > accurate, and a little bit "paranoid"... > > Thanks. > > -- > Shamil From max.wanadoo at gmail.com Thu May 8 02:42:37 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Thu, 8 May 2008 08:42:37 +0100 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <05ed01c8aeb0$68210250$6401a8c0@nant> References: <05ed01c8aeb0$68210250$6401a8c0@nant> Message-ID: <000301c8b0df$16739bd0$8119fea9@LTVM> Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max From fhtapia at gmail.com Thu May 8 08:08:28 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 06:08:28 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: I am in the middle of testing it, I will post back when I have completed my tests On 5/8/08, Max Wanadoo wrote: > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > Max > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > -- Sent from Gmail for mobile | mobile.google.com -Francisco http://sqlthis.blogspot.com | Tsql and More... From dwaters at usinternet.com Thu May 8 08:12:07 2008 From: dwaters at usinternet.com (Dan Waters) Date: Thu, 8 May 2008 08:12:07 -0500 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <000301c8b0df$16739bd0$8119fea9@LTVM> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> Message-ID: <001301c8b10d$1e4579e0$0300a8c0@danwaters> When I tried to install it by the normal method, I got an 'Access Denied' error during installation. It did gracefully uninstall all the SP3 files and I'm back to where I was no worse for the wear. I downloaded the update (about 30 minutes w/DSL) and I'll try next with that. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Thursday, May 08, 2008 2:43 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] XP Service Pack 3 and Access Does anybody have an experience of upgrading to XP SP3? If so, has it had any impact on your Access databases? Thanks Max _______________________________________________ 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 Thu May 8 11:29:49 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 08 May 2008 18:29:49 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From jwcolby at colbyconsulting.com Thu May 8 13:05:06 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 08 May 2008 14:05:06 -0400 Subject: [dba-VB] Dual boot Server 2003 X32 and x64 Message-ID: <482340D2.5090608@colbyconsulting.com> Does anyone know if it is possible to dual boot the x32 and x64 version of windows 2k3? My concern in doing so is that on the one server that I run 2k3 x64 on, there are two program file directories, one called Program Files the other called Program Files (x86). It APPEARS that the (x86) directory is the 32 bit directory which would imply that the one without was the x64, though I have nothing more to base that on than the names of the directories inside of each Program Files directory. I just got a 2nd Phenom quad core and want to convert a second system to quad core x64. The EASIEST way would be to dual boot until I have everything I need running in x64 and then cut over. -- John W. Colby www.ColbyConsulting.com From fhtapia at gmail.com Thu May 8 13:47:26 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 8 May 2008 11:47:26 -0700 Subject: [dba-VB] XP Service Pack 3 and Access In-Reply-To: <001301c8b10d$1e4579e0$0300a8c0@danwaters> References: <05ed01c8aeb0$68210250$6401a8c0@nant> <000301c8b0df$16739bd0$8119fea9@LTVM> <001301c8b10d$1e4579e0$0300a8c0@danwaters> Message-ID: I downloaded the file straight from the download center and did a normal install On Thu, May 8, 2008 at 6:12 AM, Dan Waters wrote: > When I tried to install it by the normal method, I got an 'Access Denied' > error during installation. It did gracefully uninstall all the SP3 files > and I'm back to where I was no worse for the wear. > > I downloaded the update (about 30 minutes w/DSL) and I'll try next with > that. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo > Sent: Thursday, May 08, 2008 2:43 AM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: [dba-VB] XP Service Pack 3 and Access > > Does anybody have an experience of upgrading to XP SP3? > If so, has it had any impact on your Access databases? > Thanks > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From mikedorism at verizon.net Thu May 8 16:43:29 2008 From: mikedorism at verizon.net (Doris Manning) Date: Thu, 08 May 2008 17:43:29 -0400 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: <001801c8b154$8e4561a0$2d01a8c0@Kermit> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Thu May 8 17:14:14 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 00:14:14 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Thu May 8 17:47:10 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 8 May 2008 15:47:10 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 May 9 03:50:12 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 10:50:12 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /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 Gustav at cactus.dk Fri May 9 05:36:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 12:36:19 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From Gustav at cactus.dk Fri May 9 06:22:33 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 09 May 2008 13:22:33 +0200 Subject: [dba-VB] CheckBox: Checked and CheckState Message-ID: Hi all Here's a simple dirty trick to force a validate of a CheckBox: Hide the checkbox, Show it again and set Focus. As the control looses focus, Validating and Validated will fire. The previous control will get focus. You show the control again and move focus back (and the Validating and Validated events of the previous control will fire). It happens so fast that nothing strange is to be seen for the user. private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.checkBoxRegistered.Hide(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Show(); this.checkBoxRegistered.Focus(); // Focus has been retained. // Validating and Validated of the previous control will fire. } Another option is to have a tiny dummy control containing no event code where focus temporarily can be stoved away: private void checkBoxRegistered_CheckedChanged(object sender, EventArgs e) { this.noop.Focus(); // Focus has left the control. // Validating and Validated will fire. this.checkBoxRegistered.Focus(); // Focus has been regained. // Validating and Validated of the dummy control will fire. } /gustav >>> Gustav at cactus.dk 09-05-2008 10:50 >>> Hi Charlotte > it's easier to use the validating event and check for Checked. That was one of my attempts but problem is that Validating (and Validated) doesn't fire until focus is moved to another validating control. I have a set of checkboxes, and for some of these Enabled has to be turned on and off according to the values of the other checkboxes. This should happen when you click (or press Space) any enabled checkbox. So that leaves me with Checked and CheckedState > the checked property changes before the value does. Aren't they the same? The Checked property represents the value according to IntelliSense. And - as I see it - this is set before CheckState. What I wish to understand is the difference between these. So I located here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1198715&SiteID=1 this which seems to tell that it has to do with the painting of the control (hold on): When you set the Checked property it actually sets the CheckedState property which will cause the CheckedChanged and CheckStateChanged events to be raised. When this happens the Windows message is sent (which should update the UI). However if you have enabled owner draw then Windows won't repaint anything. When CheckStateChanged is raised it will call Refresh if the control is owner draw. However if you circumvented CheckedChange then CheckStateChanged won't get raised either it appears. Therefore owner draw boxes won't paint. Are you using owner draw? If so then call Refresh in your OnCheckedChanged override to force a repaint (although you might want to do a if-owner draw statement first). I had to read this twice, mostly because I don't bother with the painting, just uses the default behaviour. What really puzzles me is that you can set either Checked or CheckState but no matter which one you set, _both_ of these are set ... and always in the same sequence: Checked, then CheckState. /gustav >>> cfoust at infostatsystems.com 09-05-2008 00:47 >>> If the checkboxes are bound, it's easier to use the validating event and check for Checked. Checkbox values get a little strange and the checked property changes before the value does. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 3:14 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi Doris So that's it? CheckedChanged happens "when" the state changes, CheckStateChanged after? Does this relate to the data source it is bound to? Like BeforeUpdate and AfterUpdate in Access? The EventArgs methods seem identical, however, for the two events. /gustav >>> mikedorism at verizon.net 08-05-2008 23:43 >>> You have to change the checkbox value (CheckedChanged event) before you can examine the CheckStateChange -- kind of like you have to process the Validating event before the Validated event. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, May 08, 2008 12:30 PM To: dba-vb at databaseadvisors.com Subject: [dba-VB] CheckBox: Checked and CheckState Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From cfoust at infostatsystems.com Fri May 9 10:45:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 9 May 2008 08:45:06 -0700 Subject: [dba-VB] CheckBox: Checked and CheckState In-Reply-To: References: Message-ID: We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.as px The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav _______________________________________________ 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 Mon May 12 14:50:05 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 12 May 2008 21:50:05 +0200 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... Message-ID: Hi all Anyone encountered this nasty bug? It seems to have lived for years(!): http://forums.microsoft.com/msdn/showpost.aspx?postid=277680&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=10 I have a Winform with a DataGridView and some bound textboxes. Data source is a DataTable. Update goes like this: this.Validate(true); this.mediaBindingSource.EndEdit(); this.mediaTableAdapter.Update(this.MyAdapter.Media); Sometimes after multiple but not stressed updates, the exception error is raised. Any ideas or workarounds? /gustav From mikedorism at verizon.net Tue May 13 06:15:30 2008 From: mikedorism at verizon.net (Doris Manning) Date: Tue, 13 May 2008 07:15:30 -0400 Subject: [dba-VB] Exception: DataTable internal index is corrupted: '5'. on ... In-Reply-To: References: Message-ID: <000001c8b4ea$a88b7d80$2d01a8c0@Kermit> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Doris It doesn't. However, I think I tracked down the issue after much trial and error. It happens if you perform multiple updates of the same row when an update is called immediately following each value change of several controls via the GUI. By only performing one update for each row, the issue seems to stay dormant. /gustav >>> mikedorism at verizon.net 13-05-2008 13:15 >>> If you were using a dataset, you would process an AcceptChanges statement after the Update. Not sure if data adapters have this option. Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, May 12, 2008 3:50 PM To: Hi Charlotte and Doris I've found that if you bind a DataTable to a non-tristate CheckBox and try to insert a new row having set Checked to either True or False but without specifying the CheckState property, the insert will fail because CheckState will pass a DBNull to the DataTable. Thus, you must bind the CheckState property to the DataTable and - for a new record - set CheckState to either Checked or Unchecked. /gustav >>> cfoust at infostatsystems.com 09-05-2008 17:45 >>> We use the CheckStateChanged event and test the Checked value of the checkbox to determine interaction with other controls. No focus shifting required. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 09, 2008 3:36 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] CheckBox: Checked and CheckState Hi all Maybe the answer is here. At least this is comprehendible and not rocket science: http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.aspx The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control. Note: If the ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state. Any comments? /gustav >>> Gustav at cactus.dk 08-05-2008 18:29 >>> Hi all What is the difference between these two events for a bound CheckBox? Whatever I try, first event CheckedChanged is fired, then CheckStateChanged - no matter if I browse the source it is bound to or if I click or keypress the CheckBox itself (has focus). /gustav From shamil at smsconsulting.spb.ru Tue May 20 12:29:50 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 21:29:50 +0400 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN In-Reply-To: <4812075D.6000306@colbyconsulting.com> Message-ID: <11cb01c8ba9f$1c873ad0$6401a8c0@nant> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- 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 shamil at smsconsulting.spb.ru Tue May 20 14:16:41 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 20 May 2008 23:16:41 +0400 Subject: [dba-VB] Fail Fast Message-ID: <11e301c8baae$08c911d0$6401a8c0@nant> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From cfoust at infostatsystems.com Tue May 20 14:32:37 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Tue, 20 May 2008 12:32:37 -0700 Subject: [dba-VB] Fail Fast In-Reply-To: <11e301c8baae$08c911d0$6401a8c0@nant> References: <11e301c8baae$08c911d0$6401a8c0@nant> Message-ID: Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 Wed May 21 16:48:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 22 May 2008 01:48:22 +0400 Subject: [dba-VB] Fail Fast In-Reply-To: Message-ID: <137801c8bb8c$649cc3b0$6401a8c0@nant> Hi Charlotte, Thank you for sharing your experience on the subject. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, May 20, 2008 11:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Fail Fast Shamil, We use a similar approach in our data tier entities. We implement business rules in the entity to handle validations on events like RowChanging and ColumnChanging and throw exceptions, some standard and some that we've defined in our own Exceptions project. The exception message gets attached to the column(s) containing errors and the whole thing is handed back to the calling routine for handling. That way, the error is triggered whether we create or modify a record from the UI or in code, and the UI can use the returned exception columnerror information to present messages to the user, roll back the edit, or whatever. We also use it to keep users from exiting a form in the middle of a record without either discarding or committing it. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Tuesday, May 20, 2008 12:17 PM To: 'Access-D - VB' Subject: [dba-VB] Fail Fast Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil _______________________________________________ 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 paul.hartland at googlemail.com Fri May 23 06:25:46 2008 From: paul.hartland at googlemail.com (Paul Hartland) Date: Fri, 23 May 2008 12:25:46 +0100 Subject: [dba-VB] Using MapPoint To Get Driving Distance Message-ID: <38c884770805230425k514699dcq1fadc18ee59e7184@mail.gmail.com> To all, I am trying to get driving distance from MapPoint 2006 using Visual Basic 6.0, which I have done. The problem being that it takes roughly two seconds to retrieve the distance. Has anyone had any experience of doing something similar and could possibly point me in the right direction of finding a faster way. Two seconds doesn't sound like a long time, but when we want to schedule about 30 people on a job, this adds around a minute to get the distance's from the employees postcode to the client's postcode. Also I am having trouble with some postcodes especially BT8 (Ireland), if you type BT8 it will not find the location, however if you put the address in it finds it and shows the postcode as BT8, where in Google maps it will find BT8 without a problem. Thank you in advance for any help on this matter..... -- Paul Hartland paul.hartland at googlemail.com From Gustav at cactus.dk Fri May 23 13:00:22 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:00:22 +0200 Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN Message-ID: Hi Shamil Thanks for that link. As I read it, Bazaar could be the choice: http://bazaar-vcs.org However, not a single word of integration with Visual Studio except for a "dead" plug-in for VS2005 ... To me, that settles it. No Bazaar for me. Anyone with some experience of Bazaar? /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 19:29 >>> Hello John, I have occasionally found today a good article on (distributed) version control systems - it points on the main issues with Subversion, which I did also experienced (especially that "Subversion fails to merge changes when files or directories are renamed" ) and which forced me to not use Subversion broadly. Have a look: Distributed Version Control Systems: A Not-So-Quick Guide Through http://www.infoq.com/articles/dvcs-guide <<< Or a more precise question: Why Central VCS (and notably Subversion) are not satisfying? Several things are blamed on Subversion: Major reason is that branching is easy but merging is a pain (but one doesn't go without the other). And it's likely that any consequent project you'll work on will need easy gymnastic with splits, dev, test branches. Subversion has no History-aware merge capability, forcing its users to manually track exactly which revisions have been merged between branches making it error-prone. No way to push changes to another user (without submitting to the Central Server). Subversion fails to merge changes when files or directories are renamed. The trunk/tags/branches convention can be considered misleading. Offline commits are not possible. .svn files pollute your local directories. svn:external can be harmful to handle. Performance The modern DVCS fixed those issues with both their own implementation tricks and from the fact that they were distributed. But as we will see in conclusion, Subversion did not resign yet. >>> Bazaar seems to be one of the best free open source options for modern DVCSs... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 25, 2008 8:31 PM To: VBA Subject: [dba-VB] Subversion, TortoiseSVN and VisualSVN OK, I have been badgered and goaded into coming into the 21st century. Not to mention I can't figure out how to safely and effectively share development of my .Net programs on all of my machines. So I am trying to get Subversion installed and functioning. So of course I come here seeking advice or to start a user group (goad and prod you guys) if no one is using this thing. I installed VisualSVN and it told me I had to install TortoiseSVN to get full functionality. It implied that it would install Subversion as well. The install did not ask any "install" questions such as where do you want the database to go etc. My intention is to place the Subversion database on one of my servers, share the directory, then place the various clients (TortoiseSVN and VisualSVN on each machine which I develop on. So my first question, is anyone out there using this thing? Is anyone interested in using this and sharing the pain of figuring it out? -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri May 23 13:35:37 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 23 May 2008 20:35:37 +0200 Subject: [dba-VB] Fail Fast Message-ID: Hi Shamil I like that approach, actually I once had the idea that error messages should be localized ... The article mentions an example of the type: On Error .. let value of variable x = 10 That is plain bad code in my opinion and makes a discussion on what approach to use difficult. However, when I think about it - encouraged by your posting - in Access I don't use error handling that much and mostly on a general level to catch disk/network errors and the like. I run so many tests on various user inputs during development that the code is virtually bug free. Well, of course not, but the level is so low that it doesn't pay off to do more about it. In most installations of our software we see zero errors a year caused by the software itself. Errors met are caused by network or hardware malfunction. With Visual Studio it is different but similar. I've found that when an error is raised, the message is so informative that I don't need more information. Also the stack window is a great help and - again - the IDE of VS demonstrated its superiority at a surprising level when I noticed the first time that code lines with jumps to other code modules are highlighted. Of course I include a try/catch here and there but I prefer to check for potential errors - like a lost connection before running a major update routine. Further, to my surprise, VS lets some errors pass which don't have to stop the code, indeed formatting errors for empty strings. This is certainly an indication of a value not intended, so I turned on the setting that will raise an error in such cases. Put a check mark in Thrown here: Debug, Exceptions ..., Common Language Runtime Exceptions, System, System.FormatException /gustav >>> shamil at smsconsulting.spb.ru 20-05-2008 21:16 >>> Hi All, Would you like to minimize lengthy debugging sessions - then use "Fail Fast" approach!: http://www.martinfowler.com/ieeeSoftware/failFast.pdf It sounds very tempting I must say, and the author's arguments are good and practical, but you can find that proposed approach is rather different from On Error Resume ... or On Error GoTo ... used in almost all and every function/sub/property approach recommended as professional programming style in VBA/VB6... To catch up inevitable bugs and gracefully present them to the users author recommends using global error handlers... Do you feel any flavors with the proposed approach? Please share them here. I do not (I could have missed some), and I do plan to adapt to this approach: I used like that in C ages ago but VB6/VBA programming made me a bit "paranoid" and I did widely use On Error... VB6/VBa construction... In my understanding proposed subject approach results in streamlined coding with less code lines, less comment lone as well as less time spent in long debugging sessions: of course "there is no free cheese in this world" and proposed approach implies using Test Driven Development but anyway overall result is positive with (significant) development and support time savings as author states (based on his broad development experience) in this subject article and in his excellent book "The Art of Agile Development" he coauthored with Shane Warden... Thank you. -- Shamil From jwcolby at colbyconsulting.com Fri May 23 18:03:51 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 23 May 2008 19:03:51 -0400 Subject: [dba-VB] CDO Email Message-ID: <48374D57.2060502@colbyconsulting.com> Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- John W. Colby www.ColbyConsulting.com From ebarro at verizon.net Sat May 24 11:05:54 2008 From: ebarro at verizon.net (Eric Barro) Date: Sat, 24 May 2008 09:05:54 -0700 Subject: [dba-VB] CDO Email In-Reply-To: <48374D57.2060502@colbyconsulting.com> References: <48374D57.2060502@colbyconsulting.com> Message-ID: <001f01c8bdb8$0f922fd0$1003000a@advancedinput.com> When you send via your forwarding SMTP server using Thunderbird are you sending (via the email client) authentication? I have to assume that most SMTP servers today expect both username and password to authenticate before they even allow you to send mail out via the SMTP service. There's a setting for authentication that you need to send. mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenti cate", 1); ' set to authenticate mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername ", uxSMTPUser.Text); 'send the smtp username mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword ", uxSMTPPassword.Text); 'send the smtp password You can adapt that .NET code for your use. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, May 23, 2008 4:04 PM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] CDO Email Folks, I was recently dernaged enough to stop using outlook (which worked just fine, but was a ROYAL PITA to move from computer to computer) and start using Thunderbird. Now... I need to use CDO to send my mail (I guess). I have a bit of an issue in that I use an SMTP "mail forwarder" to send my email, to get around port 25 blocking. I have found three different pieces of code, none of which "just work", in fact none of them work at all. Function mCDOSendMail() Dim objMessage As CDO.Message Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "jwcolby at colbyconsulting.com" objMessage.To = "jwcolby at colbyconsulting.com" objMessage.TextBody = "This is some sample message text." objMessage.Send End Function the above code gives me an error "The send using configuration is invalid". Sub CDO_Mail_Small_Text() Dim iMsg As Object Dim iConf As Object Dim strbody As String Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Dim Flds As Variant Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "smtp-auth.no-ip.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3325 .Update End With strbody = "Hi there" With iMsg Set .Configuration = iConf .To = "jwcolby at colbyconsulting.com" .CC = "" .BCC = "" .From = """John"" " .Subject = "Important message" .TextBody = strbody .Send End With End Sub The above code gives me: "The server rejected one or more recipient addresses. The server response was 554 5.7.1 : client host rejected: Access denied" This looks like SOMETHING is happening. smtp-auth.no-ip.com is MY email forwarder. The problem here is that all of these examples give NO explanation of anything that is happening. Like what in the heck is all the HTTP://schemas crap? Why is it going to microsoft.com? Am I supposed to change that? If so to what? Wouldn't it be nice if just ONE TIME example code would actually tell you what you need to know to use it? Can anyone help me with this stuff? Thanks, -- 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 jwcolby at colbyconsulting.com Thu May 29 11:19:47 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 12:19:47 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTE classification-tree editor In-Reply-To: References: Message-ID: <483ED7A3.1070206@colbyconsulting.com> I had a very interesting conversation with my tax guy this morning. He had previously worked at Lowes Hardware in their accounting department. The upshot of the conversation was that Lowes has to interface to a huge number of legacy systems, systems from suppliers, banks, systems from companies they purchased 10 years ago and inherited etc. His comment of interest is that in many cases they did not do testing. Or more correctly they threw data at the live system and looked at what happened, and then used a feedback loop to work around to what the system at the other end would accept. Sounds like poor Roz at her current assignment. I have to tell you that I have experienced this same thing. My disability insurance call center software has to interface to about 10 (so far) completely different insurance companies. Each company has dozens of legacy systems. We get "specs" for how to receive and transmit data to these mainframe systems. I write code to meet the spec, then we send data. We then get feedback from them about how to change the program to meet the "REAL spec" which is never the printed spec. Iterate until the feedback stops and they start accepting what we send without complaint. In one case they had specified how to output claim data that they wanted to enter into their system. In this one (admittedly extreme) case it was in a vertical report format, which we did. Some six months later we discovered that the format was designed to allow some key entry person to key it into their system manually, and the "report order" was the order that the data entry fields appeared on her screen. I got a chuckle out of that one. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > A local computer paper brought attention to this work related to Daimler-Chrysler but useful in many areas: > > http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 > > > This page contains papers on the classification-tree method CTM and the classification-tree editor CTE. The classification-tree method is a testing method for the systematic design of test cases on basis of the specification. The classification-tree editor is a graphical editor supporting the application of the classification-tree method. CTM and CTE are widely used in industrial practice. > > > The CTE software is free to download and use and the page contains links to a bunch of documentation. > Here's an intro: > > http://www.systematic-testing.com/documents/eurostar2000.pdf > > > > > From wdhindman at dejpolsystems.com Thu May 29 15:04:31 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Thu, 29 May 2008 16:04:31 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: ...I thought that's how everyone does it :) William "The truth is incontrovertible, malice may attack it, ignorance may deride it, but in the end; there it is." -------------------------------------------------- From: "jwcolby" Sent: Thursday, May 29, 2008 12:19 PM To: "Access Developers discussion and problem solving" ; "VBA" ; "Discussion of Hardware and Software issues" Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor > I had a very interesting conversation with my tax guy this > morning. He had previously worked at Lowes Hardware in > their accounting department. > > The upshot of the conversation was that Lowes has to > interface to a huge number of legacy systems, systems from > suppliers, banks, systems from companies they purchased 10 > years ago and inherited etc. His comment of interest is > that in many cases they did not do testing. Or more > correctly they threw data at the live system and looked at > what happened, and then used a feedback loop to work around > to what the system at the other end would accept. > > Sounds like poor Roz at her current assignment. > > I have to tell you that I have experienced this same thing. > My disability insurance call center software has to > interface to about 10 (so far) completely different > insurance companies. Each company has dozens of legacy > systems. > > We get "specs" for how to receive and transmit data to these > mainframe systems. I write code to meet the spec, then we > send data. We then get feedback from them about how to > change the program to meet the "REAL spec" which is never > the printed spec. Iterate until the feedback stops and they > start accepting what we send without complaint. > > In one case they had specified how to output claim data that > they wanted to enter into their system. In this one > (admittedly extreme) case it was in a vertical report > format, which we did. Some six months later we discovered > that the format was designed to allow some key entry person > to key it into their system manually, and the "report order" > was the order that the data entry fields appeared on her screen. > > I got a chuckle out of that one. > > John W. Colby > www.ColbyConsulting.com > > > Gustav Brock wrote: >> Hi all >> >> A local computer paper brought attention to this work related to >> Daimler-Chrysler but useful in many areas: >> >> http://www.systematic-testing.com/functional_testing/cte_main.php?cte=1 >> >> >> This page contains papers on the classification-tree method CTM and the >> classification-tree editor CTE. The classification-tree method is a >> testing method for the systematic design of test cases on basis of the >> specification. The classification-tree editor is a graphical editor >> supporting the application of the classification-tree method. CTM and CTE >> are widely used in industrial practice. >> >> >> The CTE software is free to download and use and the page contains links >> to a bunch of documentation. >> Here's an intro: >> >> http://www.systematic-testing.com/documents/eurostar2000.pdf >> >> >> >> >> > _______________________________________________ > 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 Thu May 29 15:09:34 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 29 May 2008 16:09:34 -0400 Subject: [dba-VB] [AccessD] OT: Functional Testing: CTEclassification-tree editor In-Reply-To: References: <483ED7A3.1070206@colbyconsulting.com> Message-ID: <483F0D7E.6090905@colbyconsulting.com> > ...I thought that's how everyone does it :) The bigger the company the more likely that is how it is done. John W. Colby www.ColbyConsulting.com William Hindman wrote: > ...I thought that's how everyone does it :) > > William > "The truth is incontrovertible, malice may attack it, ignorance may deride > it, but in the end; there it is." > > -------------------------------------------------- > From: "jwcolby" > Sent: Thursday, May 29, 2008 12:19 PM > To: "Access Developers discussion and problem solving" > ; "VBA" ; > "Discussion of Hardware and Software issues" > Subject: Re: [dba-VB] [AccessD] OT: Functional Testing: > CTEclassification-tree editor > >> I had a very interesting conversation with my tax guy this >> morning. He had previously worked at Lowes Hardware in >> their accounting department. >> >> The upshot of the conversation was that Lowes has to >> interface to a huge number of legacy systems, systems from >> suppliers, banks, systems from companies they purchased 10 >> years ago and inherited etc. His comment of interest is >> that in many cases they did not do testing. Or more >> correctly they threw data at the live system and looked at >> what happened, and then used a feedback loop to work around >> to what the system at the other end would accept. >> >> Sounds like poor Roz at her current assignment. >> >> I have to tell you that I have experienced this same thing. >> My disability insurance call center software has to >> interface to about 10 (so far) completely different >> insurance companies. Each company has dozens of legacy >> systems. >> >> We get "specs" for how to receive and transmit data to these >> mainframe systems. I write code to meet the spec, then we >> send data. We then get feedback from them about how to >> change the program to meet the "REAL spec" which is never >> the printed spec. Iterate until the feedback stops and they >> start accepting what we send without complaint. >> >> In one case they had specified how to output claim data that >> they wanted to enter into their system. In this one >> (admittedly extreme) case it was in a vertical report >> format, which we did. Some six months later we discovered >> that the format was designed to allow some key entry person >> to key it into their system manually, and the "report order" >> was the order that the data entry fields appeared on her screen. >> >> I got a chuckle out of that one. >> >> John W. Colby >> www.ColbyConsulting.com From ebarro at verizon.net Thu May 29 20:25:25 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 29 May 2008 18:25:25 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <483F0D7E.6090905@colbyconsulting.com> References: <483ED7A3.1070206@colbyconsulting.com> <483F0D7E.6090905@colbyconsulting.com> Message-ID: <000001c8c1f4$0b018890$c403000a@advancedinput.com> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 02:21:02 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 09:21:02 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From shamil at smsconsulting.spb.ru Fri May 30 07:45:55 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 16:45:55 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: Message-ID: <000c01c8c253$1a39aa40$6401a8c0@nant> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 09:09:15 2008 From: max.wanadoo at gmail.com (Max Wanadoo) Date: Fri, 30 May 2008 15:09:15 +0100 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000c01c8c253$1a39aa40$6401a8c0@nant> References: <000c01c8c253$1a39aa40$6401a8c0@nant> Message-ID: <000201c8c25e$c1073ad0$8119fea9@LTVM> It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 10:42:54 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 30 May 2008 19:42:54 +0400 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000201c8c25e$c1073ad0$8119fea9@LTVM> Message-ID: <000c01c8c26b$d393d7f0$6401a8c0@nant> Hi Max, Yes, this is why I'm wondering what Gustav means :) BTW, I do use multi-layered approach with a lot of custom classes and mainly ObjectDataSource controls for ASP.NET web forms - works very well but it needs one or another code generation tool: I did develop my own but maybe you'd better purchase existing ones if you do not have time to develop your own... For the task like yours (assuming ObjectDataSource and custom classes are used) I'd batch updates into transactions - that will need some more work than built-in approach you're trying to use but when that custom approach is used ((generated) custom classes + ObjectDataSource control + a few custom coding) then you have control on every bit of your program and you're not dependent on any new technologies MS will develop, and with some more efforts you can have different backends SQL Servers or even MS Access for different customers of the same application etc. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Friday, May 30, 2008 6:09 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Updating dataset from datagrid It is the one that doesn't contain option 1 or option 2 >> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav >>> "Eric Barro" 30-05-2008 03:25 >>> I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 cfoust at infostatsystems.com Fri May 30 10:50:58 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 30 May 2008 08:50:58 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: <000001c8c1f4$0b018890$c403000a@advancedinput.com> References: <483ED7A3.1070206@colbyconsulting.com><483F0D7E.6090905@colbyconsulting.com> <000001c8c1f4$0b018890$c403000a@advancedinput.com> Message-ID: I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? _______________________________________________ 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 May 30 11:32:18 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 18:32:18 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Charlotte and Eric Exactly. It will even write pass-through queries for the asking. /gustav >>> cfoust at infostatsystems.com 30-05-2008 17:50 >>> I haven't worked with ASP.Net for a while since our apps aren't currently web-based (we have one but we built it several years ago). However, our apps are built so the data tier works with either winforms or webforms. Our data entity classes are based on typed datasets, which are based on tableadapters. Once you build the data tier, it takes care of the ugly details of when and how to write to the data source. Most of our code coesn't even care whether we're working with SQL Server or Access as a back end because that's transparent to the UI project. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, May 29, 2008 6:25 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: [dba-VB] Updating dataset from datagrid I'm curious as to how you guys approach this scenario: NOTE: This is web-specific (ie ASP.NET) and SQL server specific. With the DataGrid web control you can bind it to a DataSet as the DataSource. The user can then perform CRUD operations using the Edit, Update, Cancel methods. What approach do you usually take? Option 1: Use code that sends only changed data on the DataGrid to the SQL database using the SQLCommandBuilder object? This approach basically means that you have to build in code that updates the DataSet's corresponding DataTable. Code example: 'get the target datarow that the user is on Dim targetRow as DataRow = ds.Tables("Clients").Rows(e.Item.ItemIndex) 'open it up for editing targetRow.BeginEdit() 'shadow the textbox on the datagrid Dim tb as TextBox = CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox) 'assign what the user typed in the datagrid textbox control to the appropriate DataTable column targetRow("FirstName") = tb.Text '---you may have more columns you want to update here in which case you will need to include them 'end edit mode targetRow.EndEdit() 'invoke the GetChanges method to create a second DataSet Dim dsChanges as DataSet = ds.GetChanges(DataRowState.Modified) 'merge the changes dsTarget.Merge(UpdateClients(dsChanges), true) 'initialize the connection object Dim con as SqlConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("co nnec tionstring")) 'initialize the data adapter object Dim daClients as SqlDataAdapter = New SqlDataAdapter("SELECT ClientID, LastName, FirstName FROM Clients", con) 'build the update command Dim cbClient as SqlCommandBuilder = New SqlCommandBuilder(daClients) 'invoke the Update method to update the table in the dataset daClients.Update(ds, "Clients") Option 2: Pass the parameters (fields to be updated) to a class that calls a method which in turns calls a stored procedure that executes on the SQL database using the parameters passed from the method. This approach basically means that the record is saved and hence a connection to SQL server is needed at the moment the user saves the record. Code example: Dim Cmd As New SqlCommand("UpdateClients", Conn) Cmd.CommandType = CommandType.StoredProcedure Cmd.Parameters.Add("@FirstName", CType(e.Item.Cells(2).FindControl("tb_FirstName"), TextBox).Text) Cmd.Parameters.Add("@LastName", CType(e.Item.Cells(2).FindControl("tb_LastName"), TextBox).Text) '---you may have more columns you want to update here in which case you will need to include them Conn.Open() Cmd.ExecuteNonQuery() Conn.Close() I've always used Option 2 and for the first time today I was able to get Option 1 to work. What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement in order to get SQLCommandBuilder to work its magic. In other words I can't specify a stored procedure to call (if someone knows how it can be done I'd appreciate knowing). In all my CRUD operations I just invoke a method of the Data Helper class I created specifically for that purpose and then pass the parameters as a Hashtable and finally execute the query to run. What do you guys use? From Gustav at cactus.dk Fri May 30 12:01:04 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 30 May 2008 19:01:04 +0200 Subject: [dba-VB] Updating dataset from datagrid Message-ID: Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav