Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2003, 12:20 PM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default help! DAO and controlling access dbs remotely

Hi,

I'm trying to run queries on an access database through code in another database (this is because the database is too big to sit in one access db and so i've had to split it, but i still want only one 'user interface').

I'm using DAO to do this just now, using the

database.execute("...")

command to execute sql code on the 'remote' database.

I'm having problems because i can't use the 'set warnings off' command that i would have used in a macro to stop an error occurring when I make tables which already exist (i.e. to have it automatically replace these tables). I've tried 'DROP'ing the tables before i run the above make table code, but I'm finding this causes the remote db to top out at 2GB. I presume deleting tables before replacing them instead of setting warnings off defragments the database more?

I know about the docmd.setwarnings code but to my knowledge this can only be performed on the currently open (or active) database... So, how can i get my vb to stop falling over when it tries to create a table (in a remote db) which already exists, and just replace it instead?

Any help anyone can give would be MUCH appreciated!
x
 
Old November 27th, 2003, 01:44 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 
Quote:
quote:when I make tables which already exist (i.e. to have it automatically replace these tables).

Do not drop tables on the fly. I hope you are not wharing this database, but, from your post, I see that you are not sharing one backend, but more than one backend .mdb. Access will lock a database when it is doing anything on design view or creating/deleting an object.

Do not drop tables, just delete the records and re-fill the table with the new data. Anyways, how many records are you generating?


If you must do this, you can set a link to your tables and then use the table as a local object.

By the way, use ADO instead. compact your db often and de-compile.






Sal
 
Old November 27th, 2003, 01:51 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A thought. Are You aware that You can "turn off" the warnings completely? In Access2000 it is done via
tools->
options->
edit\find.
uncheck in the confirmations section.

Dave

 
Old November 28th, 2003, 05:19 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the quick replies! Will try out both and see how they go - by the way sal what does 'wharing a database' mean?!

I'm compacting it quite a lot already, but if all else fails I'll try doing this more often. I can't create links as access views all linked databases as open and hence they are not automatically compactable from another database's code...

Thanks :)
x





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect an Access DB remotely? frossie Access 1 June 14th, 2006 08:07 AM
Access VBA - Controlling Text boxes in a form Scripts82 Access VBA 4 February 8th, 2006 08:35 PM
MySQL 4.0.14 Access Denied remotely ! wireblock MySQL 1 September 25th, 2003 11:39 AM
Controlling Outcome of Access Reports Myssi Access 3 September 16th, 2003 08:02 AM
Access dbs are ReadOnly under WinXP lcsgeek Classic ASP Databases 3 September 11th, 2003 08:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.