If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Two computers updating sql dbase

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-09, 15:16
Johalak08 Johalak08 is offline
Registered User
 
Join Date: Sep 2008
Posts: 2
Two computers updating sql dbase

Please help.

I have a VB application using sql dbase. The application is installed in two computers. I am having problems when the 2nd computer is updating the dbase and/or both computer accessing the dbase. Do i need to lock the sql dbase? Please help on how to do this.

Currently, I have this..
Form_Load()
Set adoCOnnection = New ADODB.Connection
Set adors = New ADODB.Recordset
connectstring = "Provider=SQLOLEDB.1......."
adoCOnnection.Open connectstring


cmdSave_Click()

adors.CursorType = adOpenDynamic
adors.CursorLocation = adUseClient
adors.LockType = adLockOptimistic
adors.open "SELECT * FROM.....", adoCOnnection
Dim query as String
query = "INSERT INTO .......... VALUES...."
adoConnection.Excute query
adors.Close

Any help is greatly appreciated. Thank you
Reply With Quote
  #2 (permalink)  
Old 10-29-09, 14:46
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
I would use a read-only locking for the SELECT, since you're building separate insert statements.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On