access folder at another computer with automatic Windows authentication 
January 18th, 2008, 01:35 PM
| | | 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. | 
January 18th, 2008, 01:45 PM
| | | Re: access folder at another computer with automatic Windows authentication
By the way, the installed OS on both computers are Windows XP.
I use Visual Basic 2005.
"Andrius B." <andriusbl@mail.ltwrote in message
news:uwWER5dWIHA.5396@TK2MSFTNGP02.phx.gbl... Quote:
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.
>
>
>
| | 
January 18th, 2008, 05:55 PM
| | | Re: access folder at another computer with automatic Windows authentication
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." <andriusbl@mail.ltwrote in message
news:#LZQV8dWIHA.4868@TK2MSFTNGP03.phx.gbl... Quote:
By the way, the installed OS on both computers are Windows XP.
I use Visual Basic 2005.
>
>
"Andrius B." <andriusbl@mail.ltwrote in message
news:uwWER5dWIHA.5396@TK2MSFTNGP02.phx.gbl... Quote:
>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.
>>
>>
>>
| >
>
| | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 220,662 network members.
|