Results 1 to 8 of 8

Thread: Access's TransferText Method

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Hi,

    I'm trying (without much success) to use Access's TransferText method from a VB6 program. Does anyone have any ideas?

    Thanks!

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Help!

    I could really do with some assistance guys and girls!

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008

    Question TransferText

    OK. Back on the case. What are you tring to do? Any code that doesn't work?

    Give me a bit more to work on here... I may be good, but I am not that good :-)

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  4. #4
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ..

    The following example exports the data from the Access table 'Chrisjk' to the delimited text file Chrisjk.doc using specification Standard Output:

    DoCmd.TransferText acExportDelim, "Standard Output", _
    "Chrisjk", "C:\Txtfiles\Chrisjk.doc"

    Help in Access (in that area) is pretty good...
    Don't neglect the help files...

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Yeah...but...

    Thanks guys but I meant getting the transfertext method to execute from a VB program. I know you have to replace the DoCmd with something but i don't know what and I don't know what to declare it as.

    For example I know you need to declare a database variable (e.g. Dim db as Database) and then connect to it, but then how do I get it to run the transfertext method?

    Thanks!

    [Edited by chrisjk on 11-01-2000 at 12:16 PM]

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    I use this to export to dbase 4

    This may or may not get you on your way...

    Dim Myaccess As Access.Application

    Set Myaccess = CreateObject("Access.Application")

    With Myaccess

    .Visible = False

    .OpenCurrentDatabase (TimeDatabase)

    ' Try to replace this area for text files

    .DoCmd.TransferDatabase acExport, "dbaseIV", "c:\osmsys\data\rarch", , "DATATABLE", "OUTSOURCE.dbf"

    .Quit

    End With
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Talking

    Thanks! I eventually got it to work like this...

    Dim Myaccess As Access.Application
    Set Myaccess = CreateObject("Access.Application")
    With Myaccess
    .Visible = False
    .OpenCurrentDatabase "Cool.mdb"
    .DoCmd.TransferText acExportDelim, , lstExport, txtName
    .Quit
    End With

    Trouble is...it asks for the database password which I would rather hard code..any ideas where I can put it?

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Angry

    AAAAAAAAAAAHHHHHHHH can anybody help?!?! (please read previous post in this topic)

    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width