469,648 Members | 1,552 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

how can I write a small database program, that can be used by several computers?

3
I am new to vb6, but I was trying to find how can I write a small database program, that can be used by several computers in 1 location (for example: Office), the problem i encounter is that if the two user press or add at same time the records might duplicate. Also, is there is any networking code that I have to add?
Thank you,
Feb 12 '08 #1
5 3694
debasisdas
8,127 Expert 4TB
To avoid duplicate entry make the field primary key and check for existance of record before inserting the same into database.
Feb 12 '08 #2
werks
220 100+
I am new to vb6, but I was trying to find how can I write a small database program, that can be used by several computers in 1 location (for example: Office), the problem i encounter is that if the two user press or add at same time the records might duplicate. Also, is there is any networking code that I have to add?
Thank you,
If in case that they click at the same time before adding/saving it try to Validate the record first..


-Kenneth
--"Better Than Yesterday"
Feb 12 '08 #3
OBA
3
If in case that they click at the same time before adding/saving it try to Validate the record first..


-Kenneth
--"Better Than Yesterday"
tnx for your help i have created on how to validate the primary key first before save to database i also got it in the net..but there is instances that duplicate the records

Private Sub checkid()
Dim rsuserlist As New ADODB.Recordset
existusername = False
rsuserlist.Open "select * from tblinfo where idnum=" & Val(Text1.Text), cn, adOpenKeyset, adLockPessimistic
If rsuserlist.RecordCount > 0 Then
existusername = True
End If

rsuserlist.Close
Set rsuserlist = Nothing
End Sub
Feb 12 '08 #4
werks
220 100+
Your welcome ^^


--
Kenneth
"Better Than Yesterday"
Feb 12 '08 #5
debasisdas
8,127 Expert 4TB
Its better to use

rsuserlist.Open "select count(*) from tblinfo where idnum=" & Val(trim(Text1.Text)), cn, adOpenKeyset, adLockPessimistic

for better performance.
Feb 12 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Thomas Weholt \( PRIVAT \) | last post: by
33 posts views Thread by Nick Evans | last post: by
9 posts views Thread by drhowarddrfine | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.