Avatar of PasqualeMarcantonio
PasqualeMarcantonio
 asked on

MS Access

How do I link to data base using VBA Code.
Microsoft AccessDatabases

Avatar of undefined
Last Comment
South Mod

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PasqualeMarcantonio

ASKER
I plan to open a form, test for data in a table, if the table is not found then link to the data base using VBA Code.
SOLUTION
als315

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mstlwilliams

If you want to link to a Microsoft Access database from a standalone VB program, you can use ADODB.  The connection string will need to be specific for Access.  I'm looking for a sample and will post it when I find it.
You can also set up an ODBC connection for the MS Access database and use that in your VB for connecting.

DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

There is no need to us ADODB to link to an Access MDB or ACCDB.

mx
Your help has saved me hundreds of hours of internet surfing.
fblack61
Scott McDaniel (EE MVE )

<There is no need to us ADODB to link to an Access MDB or ACCDB.>

If you mean to link tables then you're right - DAO is much easier to work with if the goal is to build linked tables from within Access.

If the OP wishes to connect to an Access database from another environment (like VB or ASP) there's nothing wrong with using ADO. In many cases it's preferable to build a connection to the Database using ADO and then work with that connection, depending on what you want to accomplish.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Has this question been resolved?  Can we close the question ?

thx.mx
Guy Hengel [angelIII / a3]

I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Scott McDaniel (EE MVE )

The author asked how to link tables with VBA. Both of these are correct, valid solutions:

http:#a35059939
http:#a35060023

Suggest you split the points between them
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

I concur with LSM ...

mx
South Mod

All,
 
Following an 'Objection' by LSMConsulting (at https://www.experts-exchange.com/questions/27193677/16-Jul-11-15-Automated-Request-for-Review-Objection-to-Delete-Q-26869004.html) to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by the Expert.
 
At this point I am going to re-start the auto-close procedure.
 
Thank you,
 
SouthMod
Community Support Moderator
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23