944,123 Members | Top Members by Rank

Ad:
May 14th, 2007
0

Archive MSaccess data into a different Access DB

Expand Post »
I have a database (myDB1.mdb) that contains related data in seven tables. Using vb6 existing in a separate application, I would like to find a way to archive this data into a new database (myArchive1.mdb) located in the same location as the main database.

I understand how to use the INSERT INTO method, but I don't know how to get specific data (SELECT * from Table1 WHERE myField = 'XYZ') from one file and put it into another file.

Do I need two connection objects, one for each db?
Is it possible under one SQL statement?
Do I need to have pre-existing tables with the same structure in the destination database?

Any and all help is appreciated.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
usavguy is offline Offline
2 posts
since Apr 2007
May 14th, 2007
0

Re: Archive MSaccess data into a different Access DB

Hi everybody, i created a database with one OLE object as data type using MS Access 2000 and want to display it in VB6 form. There are at least 20 records and i can connect and display only the text in the form but not the pictures. I used ADOdc. The error message is "No compatible source was found for this control, Pls. add an intrinsic DAta control or remote data control to the form". What do ypu mean by this. Any help will be very much appreciated.

I tried also the data control instead of ADO but it always display an error "unrecognized database format"... I also tried the example from microsoft published under Q205635 and displayed the same error.
Help please....
Thank you.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
sunga_sunga is offline Offline
1 posts
since May 2007
May 16th, 2007
0

Re: Archive MSaccess data into a different Access DB

try to use adodc control...

for usa... if you using ADODC, yes its possible to use one on SQL statement but if want to input another SQL statement, use the recordsource command in adodc codes...
Reputation Points: 10
Solved Threads: 1
Newbie Poster
cybuster is offline Offline
3 posts
since May 2007
May 18th, 2007
0

Re: Archive MSaccess data into a different Access DB

Thanks to all for your help -

I couldn't get anywhere with the adodc so I pushed forward with the ADO.Command and here's what I came up with:

Private Sub cmdArchive_Click()
Set myConnection = DE1.conTest
myConnection.Open
Dim myCommand As New ADODB.Command
myCommand.ActiveConnection = myConnection
Dim mysql As String
mysql = "INSERT INTO tblFGPlates " & _
"IN 'G:\COMMON\QC\AlphaLIMSArchive.mdb' " & _
"SELECT * FROM tblFGPlates"
myCommand.CommandText = mysql
myCommand.Execute
myConnection.Close
Set myConnection = Nothing
Set myCommand = Nothing

End Sub
Reputation Points: 10
Solved Threads: 0
Newbie Poster
usavguy is offline Offline
2 posts
since Apr 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Please Help!
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Please Help how to set CCITT u-Law audio format by using "mciSendStringA" VB6 API.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC