help: vb 6.0 / ado code to copy a table from one mdb to another 
Author Message
 help: vb 6.0 / ado code to copy a table from one mdb to another

HI
No need to open to connections..just try this:
you have to use SELECT..INTO..
and One connection
SELECT * INTO NewTable
FROM SourceTable IN 'C:\yourpath\SourceMDB.mdb'

Harinatha Reddy Gorla
        Software Engineer
Smart Software Technologies,
Hyderabad, India

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sun, 27 Jun 2004 19:03:37 GMT  
 help: vb 6.0 / ado code to copy a table from one mdb to another
Hi,

Should I open the connection for the first table and first
define a Recordset or use ADOX?

Could you please explain in more details?

Thanks,

andy

Quote:
>-----Original Message-----
>HI
>No need to open to connections..just try this:
>you have to use SELECT..INTO..
>and One connection
>SELECT * INTO NewTable
>FROM SourceTable IN 'C:\yourpath\SourceMDB.mdb'

>Harinatha Reddy Gorla
>    Software Engineer
>Smart Software Technologies,
>Hyderabad, India

>*** Sent via Developersdex http://www.developersdex.com
***
>Don't just participate in USENET...get rewarded for it!
>.



Sun, 27 Jun 2004 22:58:10 GMT  
 help: vb 6.0 / ado code to copy a table from one mdb to another
As far as I know you'll have to use one connection to do this.  This
should work:

Dim cnnTarget As New ADODB.Connection
Dim strCommand As String
Dim lngRecords as long

cnnTarget.ConnectionString = _
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
    & "C:\path\TargetDB.mdb"
cnnTarget.Open

strCommand = "SELECT * INTO [NewTableName] " _
    & "FROM [SourceTableName] IN "C:\path\SourceDB.mdb"
cnnSource.Execute strCommand, lngRecords

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 28 Jun 2004 02:03:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. COPY TABLE FROM ONE MDB TO ANOTHER

2. Help Help Need to copy a field from one table into another table

3. Copy a table from one Database (AS400 or SQL server) to another (MDB)

4. Copying MDB Table from One File to Another?

5. Creating .MDB in ADO; copying a table structure

6. Copy a table from Template.mdb to existing.mdb

7. ADO:How to copy a record from one table to another

8. ADO Copy Tables from One Database to Another (Access 97)

9. VB 6.0 - Visual FoxPro 6.0 Tables and VB

10. How to copying from one DB table to another DB table

11. Copying the structure of one Access table to a new Access table

12. Copy/Saving a recordset from one data table to another table

 

 
Powered by phpBB® Forum Software