Solved

writing DB polling application in visual basic 6

Posted on 2011-09-25
4
228 Views
Last Modified: 2012-05-12

I want to write a polling application in visual basic 6 which sits on windows taskbar on client desktop (winxp). This application should poll the db periodically and retrives the stock which has gone below the min stock level and displays on the grid.

Can some expert let me know how to accomplish this
0
Comment
Question by:venkataramanaiahsr
4 Comments
 
LVL 22

Expert Comment

by:Paka
ID: 36596656
You will have to provide more info if we are to help you.  What does the structure of the SQL database look like?  Does the database contain the stock and min level and another database contain the live data (or does it come in by another source).  Basically, you will have VB pass a SQL query to the SQL database (such as "select * from stockdata where livedata.stockprice < stockdata.minprice").  Displaying this data in a data-aware grid is pretty straightforward.  

Please provide the info requested and we should be able to help you further.
0
 

Author Comment

by:venkataramanaiahsr
ID: 36597581

The DB is Sql 2005.  For each item  min stock position is defined. I can retrieve the  current stock from soh table for each item by comparing it with min stock level for that particular item and display it in the grid. But my question is, i want to have vb application sitting on windows task bar (minimized) and continously poll the DB for this data at perioidic intervals and refresh the grid and give a pop up msg to the user of this data. I would be thankful to the experts if you could let me know how to develop this kind of application in VB.
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 500 total points
ID: 36598763
in vb you will use a timer control to wake up and perform the query against the database...

if you have a large number of stock items and the number falling below the "reorder" level is generally small then it maybe a good strategy to implement a trigger which would write the reorder situation to another table which the vb app would then query.. the actual mechanic of the process will depend on the business strategty and business rules that your organisation persues...

e.g. how do you record future demand?  do you let stock levels go negative or handle it on the customer order table...
 
     ... how what are you using to track "ordered" stock to know if you actually need to place further restocking orders?
      ... are overstock orders passed to other warehouses in the organisation for fulfilment?

0
 
LVL 14

Expert Comment

by:VBClassicGuy
ID: 36598909
In its simplest form, seems like a no-brainer. Like LowFat said, just poll the DB on a timer and update your grid. If an item is below min stock levels, display another form with its own timer that displays the info for a short period of time then unloads itself.

But you probably need more advanced functionality like LowFat is describing. If so, study his response thoroughly and work with him on this.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question