Hi,
I'm trying (without much success) to use Access's TransferText method from a VB6 program. Does anyone have any ideas?
Thanks!
Printable View
Hi,
I'm trying (without much success) to use Access's TransferText method from a VB6 program. Does anyone have any ideas?
Thanks!
I could really do with some assistance guys and girls!
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.
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...
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]
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
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?
AAAAAAAAAAAHHHHHHHH can anybody help?!?! (please read previous post in this topic)
thank you