Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Open text file using credentials

Posted on 2008-06-26
3
Medium Priority
?
727 Views
Last Modified: 2008-08-02
Hi All,

We have a PC with very little access to the network due to high volumes of different people using it. i am writing a simple app to edit a text file, but due to the restrictions on the machine i need to pass alternate credentials to the file to open it for editing.

I can easily open a file using vb but i need the syntax for passing the credentials.

Here is a snippet of my code:

Set objTextFile = objFSO.OpenTextFile(strDir & strFilename & ".csv", 8, True)

Can any one help?
0
Comment
Question by:SynsealIT
3 Comments
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 1000 total points
ID: 21887904
2000/XP have a "Run As" option when right-clicking an executable which allows you to specify alternate credentials. You can use this option instead of reinventing the wheel.

"How to enable and use the 'Run As' command when running programs in Windows"
http://support.microsoft.com/kb/294676
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question