is possible to make with vba a code to upload the current database to a ftp file (or to upload all tables to a file in the server with a record set)?
Microsoft AccessVisual Basic ClassicProgrammingWindows BatchScripting Languages
Last Comment
bill201
8/22/2022 - Mon
Jim Dettman (EE MVE)
Yes it's possible. Depending on your needs, there are several approaches.
Simplest is simply linking. When you link, as part of the file specification you use FTP://<host>
That doesn't work in all cases.
Beyond that, there are two basic techinques for FTPing a file:
1. Create a batch file and shell out to the command line.
2. Use code and the WININET lib.
Combining that along with other things (like writting a file to disk from the current tables), allows you to do just about anything.
Fill in some more details on exactly what it is your trying to do and I can offer more detail.
Jim.
bill201
ASKER
thanks alot for your answer
i have a database on a server and i want to upload a few tables (not has to be to whole database) to a database on the web
for example the database on the web name is Invoices.mdb
and i want to upload to the database on the server table from current database the tables names are "InvoiceDetailsT","InvoiceT",'"customerT"
the ftp address for example ftp://sunshop.com part 55
use name: jimmy
password:123
the address to the database is /_databases/invoices.mdb
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
i try this code in access 2010 but it's dosn't work in this version (i tried to to import InetTransferLib.mda file but it's still dons't working and i when i checked in references it's said missing inettransferlib.mda
IrogSinta
You need to import the modules from the mda file to your own database. Then in the sample code, delete any mention of InetTransferLib. For example, Set objFTP = New InetTransferLib.FTP will become Set objFTP = New FTP
Unlimited question asking, solutions, articles and more.
bill201
ASKER
IrogSinta i'm not able to import the module InetTransferLib. like i wrote when i checked in references it's said missing inettransferlib.mda
bill201
ASKER
welcome back JDettman i will be very happy to get your solution
Jim Dettman (EE MVE)
<<i have a database on a server and i want to upload a few tables (not has to be to whole database) to a database on the web
for example the database on the web name is Invoices.mdb
>>
Just to make sure I understand:
1. The database on the web server is a MDB yes?
2. What happens to the existing tables in the web server DB; are they going to be deleted first and these tables copied, or do the records themselves need to be simply added to the tables? If yes, what about changed or deleted records?
Jim.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
IrogSinta
i'm not able to import the module InetTransferLib
You misunderstand. You need to import the 4 modules that are inside the InetTransferLib.mda file. Here's a screenshot.
bill201
ASKER
IrogSinta you are right but after i import the modules i get some compile error like in the line:
.StartDir = CurDir()
and alos strStatus = String$(MAX_BUFFER, 0)
it's seems that it's need to done some changes in the code to work with this in access 2010
JDettman i want to upload a table direct to a mdb file on the server to delete this table and upload the new table. but if is not possible i will upload the whole database and overwrite the old
Unlimited question asking, solutions, articles and more.
Scott McDaniel (EE MVE )
However, note that the "Microsoft Internet Transfer Control" is not certified for use in the Access environment, so be aware of that. Also, if you're deploying this to others, be sure that they have that control on their machine (and unless you own one of the Microsoft Development Tools that allows the distribution of that control, you cannot legally deploy it).
Simplest is simply linking. When you link, as part of the file specification you use FTP://<host>
That doesn't work in all cases.
Beyond that, there are two basic techinques for FTPing a file:
1. Create a batch file and shell out to the command line.
2. Use code and the WININET lib.
Combining that along with other things (like writting a file to disk from the current tables), allows you to do just about anything.
Fill in some more details on exactly what it is your trying to do and I can offer more detail.
Jim.