Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
That makes sense - thanks @forsvarir. It looks like you've also found a problem in my second attempt - I don't actually try to connect to the second server. Are you saying that even if I do remove the declare, and connect to the second server with the same var sc- when I come out of the else scope - the connection won't be valid for sc.receive - or is that issue solely because of the second declare?
It's a VBA constant. Oops - that probably won't work - I just realized it's not 13 - it's CHR(13) - the actual ASCII key - I'll update my edit to use a constant at the top instead
Not much to the code that I can see so I'm not sure what can be optimized. How much time does it take for 1000 pages? It's possible you could speed it up slightly by use With to refer to rngPrev, and by turning Application.ScreenUpdating off and on at start and end of processing, but I don't think the improvements would be huge. It doesn't sound like a loop would apply here either - as you're processing each table individually, correct?
Just a quick update - I had NO problems whatever implementing your suggestions and the code looks so much more streamlined than before. I'm going to try and emulate that style in my other programs coming up.
Thanks again - and especially clarifying The $? variable stores the exit code of the last command. - and that grep returns 0 on success. Both of those simple statements help a lot in understanding the code. There's so much to learn and massaging code found on Internet often works but doesn't help with understanding. This site has been amazing. I can share my knowledge of PC dbs and vb coding - and learn from others on the Linux side. Soaking it all in!
Now I'm really confused - you've changed the table and the contents for hash field from a text to a number - still incremental I guess, then you've also changed the update query. Why wouldn't you include '3' in your query if you want it updated? You didn't include 'hash3' or 'hash4' in your original example.