Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 September 18th, 2003, 12:37 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transfer Text/timing problem?

I am attempting to create 2 ASCII (fixed length) files from 2 tables in my database. The code isn't difficult, but it isn't working. My code looks like this:
    MyFileName = "c:\NBDBR.TXT"
    MyFileName2 = "c:\NBDBO.TXT"
    Call DoCmd.TransferText(acExportFixed, "ExportReportsNBDB", "Reports", MyFileName)
    Call DoCmd.TransferText(acExportFixed, "ExportOrdersNBDB", "Orders", MyFileName2)

This code works in the "immediate" window. It works when I step through in debug mode. However, when I run the module, I end up with 2 files of zero size. I am guessing it is not having time to complete the commands when running real-time. Can someone help me out with a timing loop or something? Or if I'm totally off-base, can you head me in the right direction? Thanks.

Lori
 
Old September 18th, 2003, 12:48 PM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Lori,

I don't know how big are your tables. There is a limit within ACCESS but this is not the problem i think.

try to code this

DoCmd.OutputTo acTable, "mytablename", "MicrosoftExcel(*.xls)", "c:/my-tables/mytable.xls", False, ""

or DoCmd.TransferText acExportDelim, "", "mytablename", "c:\my-tables\mytable.txt", True, ""

you may create also a macro to do the same transfer.

Kind regards,
Bassam

Bassam Sater
 
Old September 18th, 2003, 01:04 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Bassamsater
 Hi Lori,

I don't know how big are your tables. There is a limit within ACCESS but this is not the problem i think.

try to code this

DoCmd.OutputTo acTable, "mytablename", "MicrosoftExcel(*.xls)", "c:/my-tables/mytable.xls", False, ""

or DoCmd.TransferText acExportDelim, "", "mytablename", "c:\my-tables\mytable.txt", True, ""

you may create also a macro to do the same transfer.

Kind regards,
Bassam

Bassam Sater

The tables vary in size; currently they contain 48 & 77 records.

If I understand your code correctly, it will produce either an Excel worksheet, or a comma-delimited ascii file. Unfortunately, neither of those will fit the bill. This is being FTP'd to an archaic system, and it will only accept the fixed-length format.

Lori
 
Old September 23rd, 2003, 02:56 AM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry then, i never tried such a file transfer.

Bassam

Bassam
 
Old October 9th, 2003, 07:01 AM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried using the Print # method?
Grab a recordset of your table and loop through it, printing out to your file.
You get each line exactly as you want it then.

Janine
 
Old October 24th, 2003, 03:22 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by janineo
 Have you tried using the Print # method?
Grab a recordset of your table and loop through it, printing out to your file.
You get each line exactly as you want it then.

Janine
Janine, you're brilliant. That worked much better than what I was trying. Thanks.

Lori
 
Old November 7th, 2003, 02:33 PM
ron ron is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Lori,

I have a process for uploading information to a mainframe through ftp using Access97 on a Windows 2000 machine. Following is what I have to write the text files:

DoCmd.TransferText acExportFixed, "CPCUpload Export Specification", "Upload", "I:\CPCUpload.txt", False, ""

Ron
 
Old November 7th, 2003, 03:52 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ron, How do you upload it to the mainframe? I am interested on more info on this.



Sal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Full Text timing out coww_pie SQL Server 2005 1 October 29th, 2007 11:47 PM
Problem in Image transfer akshah General .NET 0 February 5th, 2007 06:43 AM
Data Transfer Problem in C# akumarp2p C# 0 December 5th, 2006 11:51 AM
Data Transfer problem in C# akumarp2p C# 0 December 5th, 2006 10:38 AM
problem with "server.transfer" (maybe) gtka ASP.NET 1.0 and 1.1 Basics 0 June 27th, 2006 06:04 AM





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