Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trigger VB 6.0 Apps if new data on SQL DB

Author  Topic 

jjoya
Starting Member

5 Posts

Posted - 2009-11-22 : 20:15:38
Hello everyone,

is there anyone knows about trigger the vb 6.0 apps if SQL 2000 database has new data inserted on table without affecting the Performance of the database.

i have sample below codes about trigger.
but im using a TIMER to update and select if has a new added data on the table.

My timer interval every 5 seconds that why my database affecting and higher performance every running of timer.

Private Sub Timer2_Timer()
Dim ssql As String
Dim rs As New ADODB.Recordset
ssql = "SELECT * from Auto_ModuleSummary WHERE Tester like '%al3%' and (TestDate > DATEADD(dd, - 1, GETDATE())) AND (TestDate <= GETDATE())ORDER BY ID DESC"
Set rs = Nothing
rs.CursorLocation = adUseClient
rs.Open ssql, ConDB
Set Datagridmodsummary3.DataSource = rs
txtsnumber.Text = Datagridmodsummary3.Columns(1)
Call FillValues


Dim count As Integer
If rsLookUpTables.State = 1 Then rsLookUpTables.Close
rsLookUpTables.Open "Select Serial_No from Mdc_History where Serial_No like '%" + Text2.Text + "%'", ConDB, adOpenStatic, adLockOptimistic
count = rsLookUpTables.RecordCount
If rsLookUpTables.RecordCount = 0 Then
Call Command2_Click
Else
End If
End Sub


Hope you Help me about this problem
Using timer for every 5 seconds without affecting database performance.




Trigger VB 6.0 Apps if new data on SQL DB

jjoya
Starting Member

5 Posts

Posted - 2009-12-06 : 22:43:53
Please Help....
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-07 : 02:47:29
Why is it for only 5 seconds?
Cant you increase the time interval?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-12-07 : 10:42:43
what does the vb app do when new records appear?
Go to Top of Page

jjoya
Starting Member

5 Posts

Posted - 2009-12-08 : 23:51:56
for madhivanan:

Why is it for only 5 seconds? - to pick-up my record on the sql database to my vb6 apps (datagrid). on the datagrid, system verify if the serial number is already transacted or not. the timer runs every second. you know how to my datagrid automatic update once the sql table has new data inserted then automatic pick-up to my datagrid either no timer runs every 5 seconds.

Cant you increase the time interval? - if i increase the timer, it means my datagrid waiting for a long timer before it update.


to russell:

what does the vb app do when new records appear? - is there any possible to update my datagrid (vb6.0) once the database table has new data inserted then my datagrid automatically update also.

Please Help:

Thanks,
Joey
Go to Top of Page

jjoya
Starting Member

5 Posts

Posted - 2009-12-11 : 00:34:25
Hello. Please help...



Thanks Much!
Go to Top of Page
   

- Advertisement -