Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Alternate way to open to a client's mdb who does not have Access.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AWyszinski - 31 May 2007 16:24 GMT
Hi,
   Im just wondering if there is a better way than using Visdata on the
client's pc to go into his mdb to fix his tables. We have an app that uses
Access mdbs for the database and when we connect to remotely to fix a problem
are currently using Visdata.

Thanks,
           Alan
'69 Camaro - 31 May 2007 17:16 GMT
Hi, Alan.

>    Im just wondering if there is a better way than using Visdata on the
> client's pc to go into his mdb to fix his tables.

One could use VB Script, which is free and fairly simple if one knows how to
write queries.  For example, the following code saved as the file
AddFKeyToTable.vbs would allow one to double-click the script file and
thereby add a foreign key to the tblProducts table in the C:\Work\MyDB.mdb
database file:

   Dim cnxn
   Dim sDBPath

   sDBPath = "C:\Work\MyDB.mdb"

   Set cnxn = CreateObject("ADODB.Connection")
   cnxn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
       sDBPath & ";Persist Security Info=False"
   cnxn.Execute "ALTER TABLE tblProducts " & _
       "ADD CONSTRAINT tblSupplierstblProducts_FK " & _
       "FOREIGN KEY (SupplierID) REFERENCES tblSuppliers SupID;"
   cnxn.Close

   Set cnxn = Nothing

If an index or an extra column was needed, then the SQL statement of the
query could easily be changed and the rest of the VB Script would remain the
same.  The users don't have to be out of the database, but the script
requires a table lock, so no users can be using the table when it's being
altered by the script.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.