473,387 Members | 1,703 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,387 software developers and data experts.

Remote ADP connection to MSDE

Hello everyone.

Using Access 2003 and MSDE

I just started experimenting using Access as the front end for SQL
using *.adp, and would like to connect the front end to the back end
remotely, purely through the internet to a remote computer, hosting the
SQL Server (MSDE), but the problem is that I don't know where to
start, the only thing I do know is that I have to create a connection
string using ADO - OLE DB, something like this

oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

found at:
http://www.carlprothman.net/Default....erForSQLServer

The SQL Server would be hosted at my computer running Windows XP (Home
ed). Ideally I would like to distribute the front the to the client
computer and automate the connection to the remote server.

My questions;

What file should I distribute to the client computer, is it the *.adp I
am working???

Where do I place the connection string, and what other things should I
take into account to create a successful connection between the front
end and the back end. I have already enabled TCP/IP for the MSDE on
port 1433

Any comments would be appreciated and any direction to on-line
tutorials where I can learn this sort of things would help me a lot.

Thanks
GAVO.

Nov 14 '05 #1
4 5604
Code such as the connection string you posted must be entered in the
Visual Basic Environment and accompanied by code which instantiates the
objects you're using (in this case, oConn must be a Connection object).
You can specify a form for your database to load when it opens, and in
the Form_Load event of that form enter your connection code. For
example, your Form_Load would look like this:

Dim tbl as ADOX.Table
Dim cat as New ADOX.Catalog

Set tbl=New ADOX.Table
tbl.NAME="tblNameToCallLinkedTable"
tbl.ParentCatalog=cat

tbl.Properties("Jet OLEDB:Create Link")=True
tbl.Properties("Jet OLEDB:Link
Datasource")="MyDatasourcePathOrOtherConnection"
tbl.Properties("Jet OLEDB:Link Provider String")="This is where you put
your connection string"
tbl.Properties("Jet OLEDB:Remote Table Name")="tblNameOfTblToLinkTo"

cat.Tables.Append(tbl)

This code links a table from a remote database (your back end). You can
then use the table in the local database with queries, forms, etc.

Nov 14 '05 #2
Thank you steve.

Do I have to do the connection for every form I open, or is there a way
to create a connection for all the forms, reports, etc...

Is the way you showed me appropiate for a multiuser enviroment, over
the internet?

Thanks
GAVO.

Nov 14 '05 #3
Br
GAVO-UK wrote:
Hello everyone.

Using Access 2003 and MSDE

I just started experimenting using Access as the front end for SQL
using *.adp, and would like to connect the front end to the back end
remotely, purely through the internet to a remote computer, hosting
the SQL Server (MSDE), but the problem is that I don't know where to
start, the only thing I do know is that I have to create a connection
string using ADO - OLE DB, something like this

oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

found at:
http://www.carlprothman.net/Default....erForSQLServer

The SQL Server would be hosted at my computer running Windows XP (Home
ed). Ideally I would like to distribute the front the to the client
computer and automate the connection to the remote server.

My questions;

What file should I distribute to the client computer, is it the *.adp
I am working???

Where do I place the connection string, and what other things should I
take into account to create a successful connection between the front
end and the back end. I have already enabled TCP/IP for the MSDE on
port 1433

Any comments would be appreciated and any direction to on-line
tutorials where I can learn this sort of things would help me a lot.

Thanks
GAVO.


Yes, you'd have to distribute the ADP.

Why not just use the File/Connection menu dialog to setup your
connection?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 14 '05 #4

Steve wrote:
Code such as the connection string you posted must be entered in the
Visual Basic Environment and accompanied by code which instantiates the
objects you're using (in this case, oConn must be a Connection object).
You can specify a form for your database to load when it opens, and in
the Form_Load event of that form enter your connection code. For
example, your Form_Load would look like this:

Dim tbl as ADOX.Table
Dim cat as New ADOX.Catalog

Set tbl=New ADOX.Table
tbl.NAME="tblNameToCallLinkedTable"
tbl.ParentCatalog=cat

tbl.Properties("Jet OLEDB:Create Link")=True
tbl.Properties("Jet OLEDB:Link
Datasource")="MyDatasourcePathOrOtherConnection"
tbl.Properties("Jet OLEDB:Link Provider String")="This is where you put
your connection string"
tbl.Properties("Jet OLEDB:Remote Table Name")="tblNameOfTblToLinkTo"

cat.Tables.Append(tbl)

This code links a table from a remote database (your back end). You can
then use the table in the local database with queries, forms, etc.


Steve

For testing purposes I copied the adp to a different computer connected

to the internet on a dial up and I'm using the following code on an
"on open" even on one of the forms (unbound), but still i cannot
connect when I open the form. The funny thing is that when I run
exactly
the same adp application on the MSDE host computer it does connect
successfully.
The code is as follows;
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=NorthwindCS;" & _
"User ID=sa;" & _
"Password=xxxxx"
'Create an instance of the ADO Recordset class,
'and set its properties
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM Customers"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
End With
'Set the form's Recordset property to the ADO recordset
Set Me.Recordset = rs
Set rs = Nothing
Set cn = Nothing
I configured the firewall on the host computer to accept connection
from the remote computer by specifying its IP address and still no
luck.
Any help would be appreciated
GAVO.

Nov 16 '05 #5

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

Similar topics

1
by: Jake Jessup | last post by:
I am just beginning development of a new app and I need a little advice on the best way to go about doing something. The app is a project management tool for a construction company. Users in the...
0
by: bob .net | last post by:
Server exploI have recently installed Visual Studio .Net 2002 on my workstation running XP Professional. I can connect to local Access and MSDE databases successfully using ADO .Net. I can also...
4
by: Phil | last post by:
Hi all, I need some help to access an SQL db on another machine. I am using VB.NET and remoting to make a client/server connection...although I don't think this is relevant to the question. I...
1
by: AG | last post by:
Every night i want to send the new records that are created from my remote client to my FTP site, using a application which sets up an internet connection on the client , exports the data to the...
4
by: GAVO-UK | last post by:
Hello everyone, Using Access 2003 and MSDE "This is a follow up of a recent post" I'm trying to build an application, which I plan to distribute to remote client computers and connect the...
3
by: Jack | last post by:
i keep getting error when i try to connect to remote MSDE server
4
by: William | last post by:
I am using SQL MSDE edition due to financial reasons (it's free). I have a question regarding connection strings. Almost every publication, online example or website uses some version of the...
2
by: hfk0 | last post by:
Hi, I have a simple asp.net application running ok on my WinXP development server with SQL Server Express 2005 installed locally. After moving to the live server (Win 2000 server with MSDE 2000...
1
by: tuxthepenguin | last post by:
Hi all, I installed a MSDE on a Windows XP SP2 and configured it for accepting remote connections. But It shows the "SQL Server doesnot exist or connection denied" message whenever I try to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.