473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

OpenCurrentDatabase fails in Access 2000

Part of a Windows Service app I created in .NET 2003 has
the following code:

Dim stOutPath As String
Dim stTableName As String
Const strDBPath As String = "C:\test_be.mdb"

acApp = New Access.Application
With acApp
stTableName = "tblTest"
stOutPath = "C:\IN\test.txt"
.OpenCurrentDatabase(strDBPath)
.DoCmd.TransferText(stTableName, stOutPath)
.CloseCurrentDatabase()
End With

acApp.Quit()
acApp = Nothing

This code creates an Access application object, does an
import from a text file (stOutPath) and generates an
Access table (stTableName). This service functions on my
development machine which is running Access 2002. However
it fails to run on my production machine which is running
Access 2000. Does anyone know why this would be? I'm
certain file to be imported exists and that the Access
Application object is being created but then
the .OpenCurrentDatabase(strDBPath) fails. I just want to
rule out anything on the .NET side

Jul 19 '05 #1
2 3237
On Wed, 3 Sep 2003 07:41:20 -0700, "Zachariah" <za*********@yahoo.com> wrote:

¤ Part of a Windows Service app I created in .NET 2003 has
¤ the following code:
¤
¤ Dim stOutPath As String
¤ Dim stTableName As String
¤ Const strDBPath As String = "C:\test_be.mdb"
¤
¤ acApp = New Access.Application
¤ With acApp
¤ stTableName = "tblTest"
¤ stOutPath = "C:\IN\test.txt"
¤ .OpenCurrentDatabase(strDBPath)
¤ .DoCmd.TransferText(stTableName, stOutPath)
¤ .CloseCurrentDatabase()
¤ End With
¤
¤ acApp.Quit()
¤ acApp = Nothing
¤
¤ This code creates an Access application object, does an
¤ import from a text file (stOutPath) and generates an
¤ Access table (stTableName). This service functions on my
¤ development machine which is running Access 2002. However
¤ it fails to run on my production machine which is running
¤ Access 2000. Does anyone know why this would be? I'm
¤ certain file to be imported exists and that the Access
¤ Application object is being created but then
¤ the .OpenCurrentDatabase(strDBPath) fails. I just want to
¤ rule out anything on the .NET side

I don't know what kind of error you are getting but if I had to guess I would say it's probably a
permissions related issue.

The account under which the service is executing must have read/write/create/delete access to the
specified file or folder where the file resides.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 19 '05 #2
On Thu, 4 Sep 2003 09:50:18 -0700, "Zachariah" <za*********@yahoo.com> wrote:

¤ I don't know which error it is either. All I can do is
¤ throw in code to make log entries and that's how I know
¤ it's failing on the OpenCurrentDatabase line. The service
¤ is running with Administrator rights so it shouldn't be an
¤ authentication issue.

Couple of things you can do to troubleshoot this problem:

1) Check the System Event log to see if there are related errors.

2) Track the errors on your production machine using the Filemon utility
(http://www.sysinternals.com/ntw2k/source/filemon.shtml)
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 19 '05 #3

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

Similar topics

0
by: Mick Hardy | last post by:
Hi, Has anyone seen this weird behaviour or have any suggestions or can anyone reproduce it? The history: I converted a large third party DB from 97 to XP and it uses the...
12
by: Joe Stanton | last post by:
Hello Group I have a query that works in Oracle and SQL Server, but fails in Microsoft Access. The query is: SELECT data fromTABLE1 WHERE data>='A&' AND data<'A''' Here is my sample data:
6
by: Frank | last post by:
Straightforward VB.NET 2002 code that works form both Windows and ASP.NET apps on a Windows 2000 machine, and works in the Windows app on a newly installed XP machine, but fails in the ASP.NET...
3
by: Zachariah | last post by:
Part of a Windows Service app I created in .NET 2003 has the following code: Dim stOutPath As String Dim stTableName As String Const strDBPath As String = "C:\test_be.mdb" acApp = New...
4
by: Paul M | last post by:
Hello, when I execute the code below I get the usual access message: SECURITY WARNING---------------------------------- Opening "<filepath & name.mdb>" The file may not be safe if it...
3
by: Gary Floam | last post by:
Hello, I would like to have one Access program scan a directory and look at the form, report and module code of any Access databases it finds to search for keywords. The best way I have found...
3
by: teddysnips | last post by:
SCENARIO: Application originally developed in Access 97 several years ago. Worked with no problem until recent change from Novell to Active Directory. PROBLEM: Application was converted...
8
by: mainframetech | last post by:
We are having a problem with Access 2002 as opposed to Access 2000. A multi-file query was set up under 2000 and tested good. Access is connected through a link to an Oracle 9.1 database. The...
0
by: Matthew Wells | last post by:
How do I use OpencurrentDatabase with /user and /pwd? There doesn't seem to be a parameter for that. There is for the database pasword, but I don't need that. I'm trying to use this line without...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.