srinika
October 12th, 2001, 01:04 AM
I am having 2 similar forms with a button. Once the button is pressed, a set of generated data is to be inserted in to a table.
If 2 types of data is to be inserted by the 2 programs, what is the way of avoid crashing one program due to locking of the table?
It would be better if the answer doesn't contain any error traping mechanism.
option Explicit
Dim con as new ADODB.Connection
private Sub Command1_Click()
Dim i as Integer
'"d" is the ODBC name, corresponds to the database having table t1, with fields f1 & f2
con.Open "d"
' this part is in one project
for i = 1 to 5000
con.Execute "Insert into t1 (f1,f2) values(" & i " , 'qqqq')"
next i
' this part is in the other project
' for i = 5001 to 10000
' con.Execute "Insert into t1 (f1,f3) values("& i & " , 'xxxx')"
' next i
con.Close
End Sub
Regards
Srinika
If 2 types of data is to be inserted by the 2 programs, what is the way of avoid crashing one program due to locking of the table?
It would be better if the answer doesn't contain any error traping mechanism.
option Explicit
Dim con as new ADODB.Connection
private Sub Command1_Click()
Dim i as Integer
'"d" is the ODBC name, corresponds to the database having table t1, with fields f1 & f2
con.Open "d"
' this part is in one project
for i = 1 to 5000
con.Execute "Insert into t1 (f1,f2) values(" & i " , 'qqqq')"
next i
' this part is in the other project
' for i = 5001 to 10000
' con.Execute "Insert into t1 (f1,f3) values("& i & " , 'xxxx')"
' next i
con.Close
End Sub
Regards
Srinika