Solved

writing DB polling application in visual basic 6

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 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