Monday, December 15, 2008, 1:14 AM Other Stuff by John (Article #233)
First off, yes, I know I am a hardcore LAMP stack pimp. If there's a job to put together with LAMP, I'll do it that way.
Well, this particular job, integrating the brick and mortar retail side with the web store so that the inventory is one piece, only employs the MySQL part of the LAMP stack. LAMP just doesn't integrate very well with thermal receipt printers, cash drawer kickouts, scan guns and all the other toys it takes to scan a UPC, reduce inventory and print a receipt. Of course, I am madly in love with MySQL. MySQL is arguably the best database ever for quick and dirty solutions. Advertisements
So, I decided to dust off some Visual BASIC for the first time in a couple years. Now, my initial survey of potential solutions made me realize something quick: however awesome my old copy of VB6 is, it is out-dated. So, I bit the bullet and got a copy of Visual Studio 2005 (acquiring older versions tends to be cost-effective; for example, new versions of Photoshop offer very little if any any bang for the many, many bucks you spend -- any version from PS6 up will do).
My primary motivation in finally moving to .NET was driven by the fact that the means of connecting MySQL to VB.NET are miles easier and more trustworthy than the means for connecting to VB6. Not the least of which, the main plugin is distributed by Sun.
In my rundown of problems with the connector, nothing was too difficult.
I have to admit, I found the incompatibility between non-query and querying SQL connections a tiny bit obnoxious. Obviously, doing the majority of my coding with PHP, it's a bit foreign to me to have to drop a connection, re-establish it, and then proceed simply because the type of SQL statement I wish to handle has gone from a SELECT to an UPDATE or and INSERT.
I know PHP is arguably the most forgiving programming language since QBASIC, but it still seems a little cumbersome to have to trash a connection and re-establish it like so:
conn.Close() conn.Open()
SQL = 'UPDATE sizes SET qty = qty +1 WHERE id='' & qry & '' LIMIT 1' myCommand.CommandText = SQL myCommand.ExecuteNonQuery()
It seems like a lot of screwing around to accomlish something that can be done in two lines of code with PHP + MySQL.
Whatever the case, that's how it happens. In VB.NET, you gotta can your MySQL connection from your SELECT statement and start a new one before you can proceed with your UPDATE or INSERT. It's lame.
But, truth be told, you can be lame all you want as long as you're consistent. And VB.NET, for all its flaws, is consistent.
The other big item that annoyed me was the printer issue transitting from VB6 to VB.NET.
First off, let me say I completely understand Microsoft's motivations in trying to imrpove Visual BASIC's printer interaction. VB6 required that you dig deep into the system calls to accomplish anything beyond sending some text to the primary printer. And, of course, the primary appeal of Visual BASIC is rapid application development. Dicking around with system hooks isn't RAD. Not by a long shot.
That said, I don't understand the absence of reverse compatibility with the basic VB6 printer command:
Printer.Print('Whatever') Printer.EndDoc()
This was brain-dead easy to implement. And the vast majority of VB apps do not require advanced printing functions.
To Microsoft's credit, they did make it easy to shoehorn a solution in, using the Visual BASIC Power Packs. With a bit of code:
At the way beginning of your form's code:
Imports Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
And in the actually element's code:
Dim Printer As New Printer
Printer.Print('Whatever') Printer.EndDoc()
So, all said, it is a minor inconvenience.
Beyond that, once I shook off a little rust and learned a few quirks worth of difference between VB.NET and VB6, I was off and flying with my point-of-sale software. It now pulls names and prices and reduces or adds stock all in conjunction with the input from the scan gun. It kicks out a nicely formatted receipt to the thermal printer, which in its own turn kicks out the cash drawer.Advertisements
It really is just that damned easy.
|
© 2012 Pro Content and Design. All rights reserved.
|
Tools
Check Google PageRank
Recent articles- Government cuts and tech spending
- What's the deal with Japanese web design?
- Did the July PageRank update come early?
- Servers handling "Pending Delete" .COM domains failing
- Photoshop CS5, first impressions
- Google PageRank toolbar updates coming today
- To Microsoft's credit
- Tracking expiring and dropping domain names
- GoDaddy finally cleans up its checkout process
- Back to basics: clean up your link names
Welcome!
Wonder where to start with your web design business?
This blog follows along with my efforts to build and grow a website design business, Pro Content and Design.
The goal of this blog is to fill in blanks that may be empty as you get your business rolling.
This blog, particularly the source code section, is not intended for beginners. If you are not comfortable with databases, Ajax, DOM objects and other advanced methods, I strongly suggest you go take a look over at W3 Schools before even reading -- let alone tinkering with -- any of the code here.
I hope this blog has some value to web designers as they attempt to get their businesses going.
Good luck, and happy reading.
Thank you,
John Crawford
Pro Content and Design

Books
I highly recommend Art of the Start if you have no idea where to start with marketing.
Links
Coding
W3 Schools
IBM's Mastering Ajax Series
Graphic Design
Worth 1000
Stock.XCHNG
Urban Fonts
Website Software
Apache Web Server
SquirrelMail
PHP/Zend
Website Design Issues
Non-Standard Character Guide
Google Trends
Search Engine Optimization Analyzer
Business
Guy Kawasaki's Blog
Seth Godin's Blog
Freakonomics
Computers
NewEgg
My Main Website
Pro Content and Design
Websites I have built
PunxsyPage: local free classifieds website
Groundhog Festival: for the local summer festival
My Webapps
TV Stations Transmitter Database
Google PageRank Checker
|