Visual Basic

Learn VisualBasic.NET with Me: back on track, ole timeouts

Spending most of the evening thinking about ways to test OLE timeout code (and figuring out how to do it in .NET). The issue is simple: the server app isn't super-reliable when it handles bad data. So it will probably time out. The goal is to catch this situation, kill the server, record the error, and continue.

How To Handle OLE Automation Server Timeout and Synchronization
App Object for Visual Basic 6.0 Users

Learn VisualBasic.NET with Me: ADO.NET insight...

I just got another idea about why ADO.NET keeps local copies of remote tables. With those tables in memory, and using OO code instead of SQL, it might be a little easier to write a JavaScript-based (or C#-based) OLAP client that performs queries on the dataset. Having been a perpetual OLAP noob for, like, forever, it never occurred to me, but, I was fooling around with Excel pivot tables and had that "aha" moment.

Learn VisualBasic.NET with Me: file mirroring, lost data

I'm bummed out, because a tutorial about events, delegates, and multithreading that I wrote got lost. There was some database problem on the server, and the text didn't get saved. It just compiled information from the last blog entires, but, it was pretty good. Oh well, I must forge on with this little project.

The latest really good news is that the threading stuff is working. I also added a little time-checking feature so that the batch processor will work for a while in the evening, take a break while backups happen, and then work again in the early morning.

Learn VisualBasic.NET with Me: events, delegates, tired

Again, I didn't do much hacking. Yesterday really took it out of me, and I slept a lot (finally). Instead of hard stuff, a few simple things got done.

Copy URL+ is a great extension for [Firefox] that helps you create links to web pages. Instead of copying the URL, it lets you copy the URL-plus-title. Not only that, with a tweak, you can have HTML copied to your clipboard. It's a must-have for any blogger, writer, whatever.

Learn VisualBasic.NET with Me: type lists, cool (kinda)

I didn't hack today. Too much stuff going on, so, I did a lot of hanging out and stuff. I did manage to get a little reading done, and found a neat little feature.

A Type List is a way to let your class operate on different data types. For example, if you created a Tree class, a type list could specify that it's a tree of Oranges, or a tree of Integers. Of course, if you just made it a tree of variants, and used variants everywhere, then it wouldn't matter.

Learn VisualBasic.NET with Me: threading, events

My unexpected excursion in to .NET programming has been leading me to learn a lot of little things that are new to me. I'm chronicling them here as an assistance to others doing the same, and to get some personal insight into how I learn these things.

Last night was spent reading a bit more about ADO.NET. There was a very good MSDN article, Best Practices for Using ADO.NET, that gives you an overview of how to use ADO.NET. It's best to read it after getting some experience with ADO from another source.

Learn VisualBasic.NET with Me

For the past week or so, I've been learning VB.NET (emphasis on .NET) to do what I thought a perl script and a little VBA was going to knock out. I'll be blogging a little bit on what I learn, as I learn it. To catch up on what's happened so far, see: /node/376 and the parent nodes.

Part 2: a VB.NET Version of this Project

After a while, it became obvious that there was no way to drive the ArcMap application from Excel -- timeouts from errors wouldn't get handled, so bad runs would hang.

A real app could raise errors on timeouts, so, I had to learn VB OLE programming. Fortunately there's a free version of VB called VB Express Edition. It's a complete VB environment, that uses .NET. Unfortunately, there aren't references for the old VB classes included. .NET is, in parts, a bit more complex than VB - it's a victim of feature-itis. There are also fewer VB.NET tutorials out there.

Here's a diagram of the "new" system, which is, mostly, going to be an iteration of the "old"system.

The app is broken into three parts. One part manages a list of files. One part is a bunch of "scripts" that do the actual work of analyzing, copying, and deleting files. One part is a scheduler that will run the scripts only at specified times, so that it won't interrupt the normal workday.

More VBA Sample Code

Here's some more code to use.

Sub test()
    Dim pDoc As IDocument
    Dim pApp As IApplication
    Set pDoc = New MxDocument
    Set pApp = pDoc.Parent

Careful File Copy

This area of the site was getting really chatty, so I've removed it from the Software book, and moved it under DIY notes. The remainder of the experience will be put on the blog. Consider all the material on this page obsolete.


I was asked to help migrate a large batch of ArcMac GIS files to a new server. The problems: the files contain references to other files, and all those files must also be copied. Also, these files are mixed in with other files, not pertinent to GIS, on a single server. To manage growth, it's necessary to move the GIS files out.

Syndicate content