Solved

writing DB polling application in visual basic 6

Posted on 2011-09-25
4
223 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sql Audit table 3 49
Incremental load example 2 43
execute a MS SQL script as a schedule SQL job 72 101
Spell Check in VB6 13 52
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now