Link to home
Start Free TrialLog in
Avatar of crystalsoft
crystalsoft

asked on

how to connect remote access by using vb6.0

Hello experts

i have created VPN connection both side (Server and client), and i can access shared folder which is on server from client machine. ( \\myservername\sharedfolder)

vb application is on the client side and database is on the server.

How can i connect database through my vb6 application

i can connect local database using following connection string.

con.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\Tran.mdb;Jet OLEDB:Database Password=88888"

But how can i connect remote access database, what string must i use,

Please reply me soon as possible
Its urgent i need to solve this problem

Thanks

Crystal
Avatar of hes
hes
Flag of United States of America image

Data Source=\\myservername\foldername\Tran.mdb;
If MDB is located on a Network Share
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq=\\myServer\myShare\myPath\myDb.mdb;" & _
           "Uid=admin;" & _
           "Pwd=88888"
ASKER CERTIFIED SOLUTION
Avatar of Rahul Gupta
Rahul Gupta
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of crystalsoft
crystalsoft

ASKER

Thanks for reply

Run time error
Data Source=\\crystal\abc\Tran.mdb;    isn't a valid path make sure the path name is spelled correctly and that you are connected to the server on which file resides


Rahul

what must i write in myShare

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq=\\crystal\myShare\abc\tran.mdb;" & _
           "Uid=admin;" & _
           "Pwd=88888"
\\computername\\shared drive\shared folder path\database name

for example : \crystal\c\databasefolder\datbase.mdb

crystal= your computer name
c= your shared drive name
database folder=where your database resides
database.mdb=name of your mdb database
Note:
\\home - It is the name of the server on which the access database exists
App_Data - It is the name of the folder
test.mdb - It is the name of the access database

Try it..
Dim dbC As New ADODB.Connection


ps = "\\home\App_Data\test.mdb"

dbC.Mode = adModeShareExclusive + adModeReadWrite
dbC.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=" & ps

dbC.Open

dbC.Close

Open in new window

Rahul

Your second suggestion is working fine,
but its taking time to write data entry from application to remote database,
i am using wireless connection with 37 kbps download speed and upload speed is 26 kbps
 is this the reason for taking time to put data from application to remote database or something else,?

it depends on the network speed.

Raahul

Please suggest me
what minimum internet speed required, ?


and Thanks You solved my problem, now i can connect remote database and on punch i can send data to the server,
just the part need to look is speed,  so user can work speedy and easily, without waiting till process complete.
256kbps is the recommended Internet speed required.
Thanks a lot Rahul

You solved my problem,

You Deserve A Grade :-)