Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to attach to an existing Database 1

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,207
US
I'm very green to ADP's...

Is it possible to create an Empty ADP and attach to an existing SQL database and have the tables behave as native, if so how? What about views and stored procedures?
 
As I develope for several clients, using the same application I made a little form that has buttons per client database.
It is a matter of building the connectstring:
Code:
ConnectStr="Provider=SQLOLEDB;Data Source=<servername>;User ID=sa;Password=<somefunnypassword>;Command Timeout=900;Connect Timeout=100;General Timeout=100;Persist Security Info=TRUE;Initial Catalog=<clientsdatabasename>"

CurrentProject.OpenConnection ConnectStr
Good luck
Hans
 
Hans, I don't know if this helped anyone else, but it helped me tremendously. Thanks for posting it.

Paul
 
Little extra:
Data Source=<servername>;
<servername> this may also be an
IP-address or
IP-address,portnumber

Like:

Data Source=123.456.789.123
Data Source=123.456.789.123,1443

In this way i connect to my developDB and to he clientsDB for which I run maintenance.

Thanks for the star.

Using SQL-compare bundle from Redhat/Red Gate, you can easily manage several db's.

Good luck,
Hans
 
To answer my question...

Open Access.

From the File Menu, Select New.

In the New File Pane on the right, select Project using Existing data.

From that point it is pretty obvious.
 
I have used Access for years but I am just recently looking at the project aspect. I am wondering if I can create a project and connect to an Oracle database as opposed to SQL server? I am migrating the database to Oracle and would like a simple way of changing the record source of the forms and reports.
 
Have no experience with Oracle. But suppose it's a matter of Provider.
As far as I know you can connect an adp to any provider/datasource, maybe even flat files :)

Find out the provider and having the server running and accessible, your job is easy enough.

Good luck.
Hans
 
I have to disagree with smitan... Access Data Projects are SQL server only. You can however use an MDB file and use ODBC. You can even link your tables in and use Jet queries (very slow). You can also make SQL Pass Through queries that pass statements directly to your database sever.

However, using the project object in code should support all connections like smitan is suggesting. Just know that you are using ADO to make the connection.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top