473,606 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Table / Modify Table in remote database

I'm using Access XP.

I'm trying to create a table, modify a table, create in index, and create a
relationship in a remote database in code from the program database.

I know how to create and manipulate resident tables using code but not a
remote or attached database.

Any help you could provide would be greatly appreciated

Thank you!
Jo
Nov 13 '05 #1
2 4973
You need to open the remote database as an object.

Dim objAcc As Access.Applicat ion
Dim extDB As DAO.Database
Set objAcc = GetObject(strRe moteDB_FileName )
Set extDB = objAcc.CurrentD b
From there, you can do anything you need to do in extDB (the "remote"

database) as if it was the local database. Just remember to preface
your commands with "extDB." or "objAcc." (depending upon what level you
need to operate at) so Access doesn't try to do it in the local DB.

objAcc.DoCmd.De leteObject <whatever>
or
extDB.Execute <SQL string>,dbFailO nError

As always, remember to close and set to nothing your objects.

Oh, and a warning... Remember to make a _copy_ of the remote database
before doing anything to it! This will give you a chance to abort
whatever you are doing if (when!) something unexpected happens (and
experience says: it will.)

Nov 13 '05 #2
Thanks Chuck, I'll give that a try.
"Chuck Grimsby" <c.*******@worl dnet.att.net> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
You need to open the remote database as an object.

Dim objAcc As Access.Applicat ion
Dim extDB As DAO.Database
Set objAcc = GetObject(strRe moteDB_FileName )
Set extDB = objAcc.CurrentD b
From there, you can do anything you need to do in extDB (the "remote"

database) as if it was the local database. Just remember to preface
your commands with "extDB." or "objAcc." (depending upon what level you
need to operate at) so Access doesn't try to do it in the local DB.

objAcc.DoCmd.De leteObject <whatever>
or
extDB.Execute <SQL string>,dbFailO nError

As always, remember to close and set to nothing your objects.

Oh, and a warning... Remember to make a _copy_ of the remote database
before doing anything to it! This will give you a chance to abort
whatever you are doing if (when!) something unexpected happens (and
experience says: it will.)

Nov 13 '05 #3

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

Similar topics

9
3165
by: jab | last post by:
Je veux lier (join) une table qui se trouve dans une database avec une qui se trouve dans une autre database. Les 2 databases sont sur le même serveur en l'occurence DB2/NT 7.2.9. J'ai créé un wrapper avec le control center (j'ai utilisé DRDA) et ensuite j'ai voulu créé le serveur mais avec le wizard, il ne me présente pas mes tables ! J'ai donc essayé en ligne de commande. J'ai essayé la commande suivante: CREATE SERVER TEST TYPE...
3
3868
by: blindsey | last post by:
Is there a tool that can take an Access database and generate SQL "CREATE TABLE" statements for all the tables in it?
3
2837
by: MLH | last post by:
I was running the following code while logged in as a user belonging only to the Users group. Set usrNew = .CreateUser(Me!UserID) 'The user ID is in a control on the form usrNew.PID = "AAA123456789" usrNew.Password = "password" .Users.Append usrNew
9
3218
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database and not the file itself. To do this I will need to have a File class property for Create time and date that will let me "set" the Create time and date of the file to my own chooseing. The VB file class does not appear to have the ability
9
8288
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the records in the database. Is it possible to create a SQL Server database using vb.net? I know I can use vb.net and ADOX to create a Access database. But I can't create SQL database using vb.net.
4
8116
by: Wayne Wengert | last post by:
I am trying to create a VB.NET Windows application to move some data from a local Access DB table to a table in a SQL Server. The approach I am trying is to open an OLEDB connection to the local Access DB and then add a Linked Table pointing to the table on the SQL Server and then run an "Insert Into (linked table)" query to add the new rows. I am having a problem getting the syntax to add that linked table to my local Access DB. When I...
3
2291
by: fritz-bayer | last post by:
Hi, is it possible to create remote virtual tables in mysql? By that I mean if it is possible to define a table, which actually resides on a remote mysql server, but which can be accessed and addressed as if the table would be on the local database. My intention is to move one table to a remote host, but to be able to address the table as if it was still on the same machine.
4
1715
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Here is my problem. I have a program that will create a registry key, however it is not and here is the code and also the error that follows: Imports System.IO Imports System.Text Imports System.Security.Cryptography Imports System.Net Imports Microsoft.VisualBasic.Conversion Imports System.Management
11
4075
by: raylopez99 | last post by:
Keep in mind this is my first compiled SQL program Stored Procedure (SP), copied from a book by Frasier Visual C++.NET in Visual Studio 2005 (Chap12). So far, so theory, except for one bug (feature?) below. At some point I'm sure I'll be able to laugh about this, akin to forgeting a semi-colon in C/C++, but right now it's frustrating (time to sleep on it for a while). Problem-- For some reason I get the error when trying to save files...
0
8045
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7981
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8467
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
5994
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3952
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2458
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1315
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.