473,657 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question in .vbs script to pull export from Access

I have a .vbs script that I'm running from the Windows destkop (intend
to have it run by Windows' task scheduler) to pull an export from MS
Access. Here's the script:

' *************** ***********
dim objAccess
Set objAccess = CreateObject("A ccess.Applicati on")

ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

ObjAccess.DoCmd .TransferText acExportDelim, "Expout Export
Specification", "table1", "C:\expout.txt" , False, ""

ObjAccess.Close CurrentDatabase
Set ObjAccess = Nothing

MsgBox "Script has finished running."
' *************** ***********
....in this code, "Expout Export Specification" is an export spec I
defined in Access for this simple, 3-col. test table. Using it to
export from within Access works fine.

I get no errors in this script, but the output file is not updates
when this is run. No write to that file takes place. I am required
to have some kind of file present on the filesystem at, in this case,
C:\expout.txt or the script complains that it can't find the file.
That seems odd to me. But again, the file is not updated.

What am I doing wrong? Thanks!

bp
Nov 12 '05 #1
2 4291
This won't automatically overwrite the existing file, I don't think.
You'd have to put a kill statement in your code before running the
export to delete the existing file first.

something like:

Public Function ExportFile()
On Error Resume Next

Kill ("C:\MyTestExpo rt.txt")
DoCmd.TransferT ext acExportDelim, "MySpecificatio n", "MyTable",
"C:\Test.tx t", True
End Function
Nov 12 '05 #2
In article <bf************ **************@ posting.google. com>,
pi********@hotm ail.com (Pieter Linden) wrote:
This won't automatically overwrite the existing file, I don't think.
You'd have to put a kill statement in your code before running the
export to delete the existing file first.

something like:

Public Function ExportFile()
On Error Resume Next

Kill ("C:\MyTestExpo rt.txt")
DoCmd.TransferT ext acExportDelim, "MySpecificatio n", "MyTable",
"C:\Test.tx t", True
End Function


Hmm...

As I understand, the TransferText method does indeed overwrite the file
if it is present. It is odd to me that it must be present or I receive
a file-not-found error, as well.


bp

--
Heisenberg may have slept here.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3314
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the hosting available to me for this particular page prohibits me from using php/mysql as i would like. my script works simply by using output buffers and an include the relevant section of code is as follows: ob_start();
2
1756
by: OneSolution | last post by:
Hi All, I found out that I can use the header function to redirect a page. However, it gives me an error like that: Warning: Cannot add header information - headers already sent by (output started at /xxx/xxx/html/xx.php:10) in /xxx/xxx/html/xx.php on line 11 Here's my code:
5
1749
by: news | last post by:
I have a new situation I'm facing and could use a suggestion or two, as I don't seem to be able to think in the abstract very well. We have a local server which holds all of our image files. We have a remote server that runs our public Web server and mySQL database. I need to be able to run a script that will: Read the contents of a dir on the local server and a. make thumbnails of the files in it b. querey the database and pull...
7
2619
by: Gustavo L. Fabro | last post by:
Greetings! Some classes that once compiled without problems on VS 2003 have now problems on VS 2005 Beta 1. I'm talking about a __nogc class that is exported with __declspec(dllexport). The compiler message is this: VCSelectLibraryForm.cpp ...\Forms\QiForm.h(48) : error C3395: 'TQiForm::GetDotNetMouseButton' :
14
1454
by: Frank Rizzo | last post by:
I realize that this maybe the wrong forum, but maybe someone has run into this situation before. I sell an app and I want to offer my customers a migration path from a competing product. However, my competitor stores all data in an Microsoft Access database, which is password protected. Now, I can easily break the password and export all the data necessary into my app. In fact, I did break the password by downloading a $10 app from the...
9
2409
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that when I give a path like @"C:\holdfiles\myfile.txt" it looks on the server C drive. How do I pull from the client? Do I need a different class and/or method? Filestream? -- Thanks,
4
7357
by: =?Utf-8?B?QnJpYW5ESA==?= | last post by:
Hi Does anyone know of a way (via code behind) to pull a single sheet out of a Excel workbook and convert it to a stand alone html document? Thanks Brian
3
3109
by: bluedogsd | last post by:
I have a new server RHE4 and I am having an issue I have never had before and it's kind of urgent. Running Apache 2.0 I need the web server to have writable access and getting denied - I'm pretty sure my users/groups/permissions/etc are all good. Apache is running as user apache group ftpusers. server root for default server is at the top /export/home chowned to apache and grped to ftpusers recursively. Even so with permissions...
7
1734
by: Petra Meier | last post by:
Hello, if I use the following function for all my mySql commands in php, am I protected against all SQLinjections and XSS attacks? function sanitize($value){ return mysql_real_escape_string(htmlspecialchars($value)); } and i.e.
0
8820
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.