How to: Update Records (complicated)

Reply

Join Date: Jan 2008
Posts: 57
Reputation: werks is an unknown quantity at this point 
Solved Threads: 1
werks's Avatar
werks werks is offline Offline
Junior Poster in Training

How to: Update Records (complicated)

 
0
  #1
Feb 27th, 2008
Hi experts this is an urgent question. how do you import and export database online?

I have 2 equal database. I uploaded my FrontEnd(OPAC) and Database online. I have also a same database in my BackEnd(VB6) located in my computer. My problem is how do i update both database in every transaction done.

E.g. I added a record in my backend, the system will automatically update the database record online.

how can i accomplish this? is it possible? Tnx.

BTW im using VB6, ASP and Access
Kenneth
"Better Than Yesterday"
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: How to: Update Records (complicated)

 
0
  #2
Feb 27th, 2008
Yes it is possible, but in ASP you need to create two connections, one to each server, along with two recordset objects. Once you do this, just do an update on both. However, you need to make sure that your one at home is connected to the internet at all times.

If you do not wish for this to happen, then you need to manually create a page that grabs all records in the online database that are not within your home database. Then insert those. Use something like:

SELECT * FROM Comments WHERE CommentID IN (" & An array of your comment id's from yoru home database & ")
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 57
Reputation: werks is an unknown quantity at this point 
Solved Threads: 1
werks's Avatar
werks werks is offline Offline
Junior Poster in Training

Re: How to: Update Records (complicated)

 
0
  #3
Feb 27th, 2008
How can i do that.. Please guide me through
Kenneth
"Better Than Yesterday"
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: How to: Update Records (complicated)

 
0
  #4
Feb 27th, 2008
well, are both connected to the internet? If so, just create two connections:

conn1 = Server.CreateObject("ADO.Connection")
conn2 = ...

conn1.provider.. etc.
conn2.provider.. etc.

Then just grab your information from conn1 with an SQL statement:

SELECT * FROM Users WHERE DateCreated > (lastdateyoudidthis.Thisavoidrecordsrepeated)

Then just do a loop for insert statements:

while Not recordsetname.EOF
SQL = "INSERT INTO Users_Bak "....
conn2.execute(SQL)

recordsetname.MoveNext
loop
Last edited by SheSaidImaPregy; Feb 27th, 2008 at 5:38 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 178
Reputation: sbv is an unknown quantity at this point 
Solved Threads: 8
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: How to: Update Records (complicated)

 
0
  #5
Mar 1st, 2008
Hello,
This is good issue. And a nice solution.
Accept Challenges and Enjoy Coding... :)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC