Connecting Tech Pros Worldwide Forums | Help | Site Map

access folder at another computer with automatic Windows authentication

Andrius B.
Guest
 
Posts: n/a
#1: Jan 18 '08
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.



Andrius B.
Guest
 
Posts: n/a
#2: Jan 18 '08

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.
>
>
>

Shuja Ali Zaroo
Guest
 
Posts: n/a
#3: Jan 18 '08

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.
>>
>>
>>
>
>
Closed Thread