473,396 Members | 2,003 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,396 software developers and data experts.

access folder at another computer with automatic Windows authentication

Hi.
I am writing an app, whitch has to access a database, located on another
computer (Intranet).
Let's say, the computer where the app is to be installed, is "Computer1".
The computer with the database is "Computer2", and the full path to needed
database is "\\Computer2\AppFolder\mydata.mdb".
The user can access that folder when it authenticates as "user1" with
password "password1".
Question: how to automate the connection, making it possible to log to the
computer2 automaticaly at run time programically?
By default, the app, without authenticating, cannot open that database, so
it shows FileOpen dialog for browsing to the desired computer, then to the
shared folder, at this step the input form appears, asking to enter username
and password; the app's user enters them, and succesfully enters the folder
and selects the database, and the connenction is performed.
So, could this be done faster, eg. writing some parameters to the database's
connection string, o using IO.System objects or so on?
The code below describes the connection to db:

' Start of code
Dim sConnSample = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Persist Security Info=False; Jet OLEDB:Database Password=andriusbl5; " &
"Data Source=" & \\Computer2\AppFolder\mydata.mdb
ADODBconn = New ADODB.Connection
ADODBconn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
ADODBconn.Open(sConnSample)
' End of code

So, should I add some parameters to cConnSample, like "UserId" ?
Thanks in advance.
Jan 18 '08 #1
2 6051
By the way, the installed OS on both computers are Windows XP.
I use Visual Basic 2005.
"Andrius B." <an*******@mail.ltwrote in message
news:uw**************@TK2MSFTNGP02.phx.gbl...
Hi.
I am writing an app, whitch has to access a database, located on another
computer (Intranet).
Let's say, the computer where the app is to be installed, is "Computer1".
The computer with the database is "Computer2", and the full path to needed
database is "\\Computer2\AppFolder\mydata.mdb".
The user can access that folder when it authenticates as "user1" with
password "password1".
Question: how to automate the connection, making it possible to log to the
computer2 automaticaly at run time programically?
By default, the app, without authenticating, cannot open that database,
so it shows FileOpen dialog for browsing to the desired computer, then to
the shared folder, at this step the input form appears, asking to enter
username and password; the app's user enters them, and succesfully enters
the folder and selects the database, and the connenction is performed.
So, could this be done faster, eg. writing some parameters to the
database's connection string, o using IO.System objects or so on?
The code below describes the connection to db:

' Start of code
Dim sConnSample = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Persist Security Info=False; Jet OLEDB:Database Password=andriusbl5; " &
"Data Source=" & \\Computer2\AppFolder\mydata.mdb
ADODBconn = New ADODB.Connection
ADODBconn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
ADODBconn.Open(sConnSample)
' End of code

So, should I add some parameters to cConnSample, like "UserId" ?
Thanks in advance.

Jan 18 '08 #2
Hi Andrius,
You will need to MAP the network drive using network credentials and then
you can access the database. One way of setting up a Map drive would be to
use Process.Start along with NET USE Dos command.

Shuja

"Andrius B." <an*******@mail.ltwrote in message
news:#L**************@TK2MSFTNGP03.phx.gbl...
By the way, the installed OS on both computers are Windows XP.
I use Visual Basic 2005.
"Andrius B." <an*******@mail.ltwrote in message
news:uw**************@TK2MSFTNGP02.phx.gbl...
>Hi.
I am writing an app, whitch has to access a database, located on another
computer (Intranet).
Let's say, the computer where the app is to be installed, is "Computer1".
The computer with the database is "Computer2", and the full path to
needed database is "\\Computer2\AppFolder\mydata.mdb".
The user can access that folder when it authenticates as "user1" with
password "password1".
Question: how to automate the connection, making it possible to log to
the computer2 automaticaly at run time programically?
By default, the app, without authenticating, cannot open that database,
so it shows FileOpen dialog for browsing to the desired computer, then to
the shared folder, at this step the input form appears, asking to enter
username and password; the app's user enters them, and succesfully enters
the folder and selects the database, and the connenction is performed.
So, could this be done faster, eg. writing some parameters to the
database's connection string, o using IO.System objects or so on?
The code below describes the connection to db:

' Start of code
Dim sConnSample = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Persist Security Info=False; Jet OLEDB:Database Password=andriusbl5; " &
"Data Source=" & \\Computer2\AppFolder\mydata.mdb
ADODBconn = New ADODB.Connection
ADODBconn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
ADODBconn.Open(sConnSample)
' End of code

So, should I add some parameters to cConnSample, like "UserId" ?
Thanks in advance.

Jan 18 '08 #3

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

Similar topics

7
by: wrytat | last post by:
Hi! I'm very new to ASP.NET and really need some good advice from experts here. I'm creating a web application for my company now. This application has 2 parts. 1 part for the customers to...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
12
by: Chad Crowder | last post by:
Hi all, I hope someone can give me a hand, because I'm out of ideas. I keep getting this message: Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET...
1
by: Microsoft News | last post by:
I have a web server sitting on computer 1, (QA1). Out on the network on my main server I have a folder with a zip file in it. All I want is for the web services that are on the web server to pick...
1
by: Jody Gelowitz | last post by:
We are having an issue in that when trying to read a file that is on Server2 from Server1 (through our ASP.NET project), we receive the error: Access to the path "\\Server2\MyShare\MyFile.tif" is...
4
by: TrinityPete | last post by:
Hi all, We have a web application that uses web services for data access and retrieval. The web app and web services reside under IIS on the same server(WIN2003). The virtual directories have...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
3
by: Charlotte | last post by:
Hello, info: I'me a rookie with IIS I have on a WinXP Pro the IIS installed, so I can test some pages before uploading to the hostserver online on the hostserver is a possibility (with the...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
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...
0
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,...

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.