Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2006, 07:15 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default using DoCmd.TransferDatabase in VB

Hi All,

I am not able to understand how to use docmd.transferDatabace in VB6.0 application.

It is working fine if i am using this with Ms access macros.

DoCmd.TransferDatabase acExport, "Microsoft Access", strFile, acTable, strTable, strTable

when I tried to use the same in an VB6.0 application it gives error like this operation requires an open connection.

Please help me

Surjit
 
Old April 21st, 2006, 04:01 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

What library do you have added in your references to get access to a “DoCmd” class?
I opened a VB project to look into your question, and there is no "DoCmd" class available.
I tried adding DAO and Jet, but neither had that class in them.
 
Old May 18th, 2006, 10:52 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

    Dim acApp As Access.Application
    Set acApp = New Access.Application
    acApp.OpenCurrentDatabase MDBFile
    ....
    acApp.DoCmd.TransferDatabase acExport.....
    ....

you can use 'DoCmd.TransferDatabase' in Ms access macros,because it's just embed in Access application,but to do this in VB,you will have to build an application in advance.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Help regarding DoCmd Pramodhegde Access VBA 1 September 7th, 2007 07:05 AM
Error when using TransferDatabase DrewMills Access VBA 2 November 14th, 2005 06:09 PM
transferdatabase help clowns119 Access VBA 0 February 19th, 2005 11:57 AM
TransferDatabase Macro jmss66 Access 13 January 21st, 2005 11:22 AM
DoCmd.TransferDatabase poonjabba Access VBA 1 August 19th, 2003 07:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.