Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening another access database 1

Status
Not open for further replies.

balllian

MIS
Jan 26, 2005
150
GB
Is it possible to open another access database from within the current database im using. im running running an autoexec macro when starting up the current database so i need the other database to fire when running this autoexec macro.

Any ideas on how best to do this.

Thanks in advance
 
Hi balllian.
Could you just link the relevant tables instead?
 
What do you want to do ?

Open the other database and just let it do its thing - then use the Shell command to run Access with the desired .mdb file in the reference.

If you just need to run some action queries on the other db then you can use the 'IN otherdb.mdb' clause in the action query within your initial database.


'ope-that'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Im importing a text file which is approx 1.5gb in size. when that is imported into access this more or less hits the capacity of access. Im using access to clean up the ext data in database 1 by running a number of update queries before then exporting it out to database 2 using the 'Transfer database' function within the autoexec macro.

In database 2 im aiming to move the data from one table to another so i can add newdata to existing records, When i use the 'transferdatabase' this knocks out existing data which is bad or me.

What im trying to achieve here is when database 1 has moved the data to database 2 i want to move the data from one table to another so new data is appended to my monthly table.

I have had to use two databases because of the size of the text file that i import into access gives very little room to manovoure when importing new information into the same area.

What would be the best way to get database 1 to operate database 2 after it has exported the information across. I have created a autoexec on database to append the information from 'table 1' to 'table 2' but dont know how to open the database up from the autoexec on database 1.

i hope this makes sense.

thanks in advance
 
i think the shell function is what i need to use. can anyone advise me what needs to be written so that i can put this code in a module so i can place this in my autoexec macro.

This is the firstime i have used/heard of this shell function in vb so im a complete novice with regards to this.

Thanks
 
Instead of using Transfer Database how about using an Append query ?

Eg

Code:
INSERT INTO tblTable2( Table2Id, Field1, Field2 ) IN 'C:\MyFolder\Target2.mdb'
SELECT Table1Id, Field1, Field2
FROM tblTable1;



'ope-that-'elps.


G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
i ve done the following but have got an error message back

'Number of query values and destination fields are not the samre'

INSERT INTO Combined1( Combined1.Date, Combined1.[IP address], Combined1.[Website URL], Combined1.Country, Combined1.Username, Combined1.Browser, Combined1.Template, Combined1.Session, Combined1.Language, Combined1.Referrer, Combined1.Profile, Combined1.Product ) IN 'C:\Weblog1\Weblog2\page_views.mdb'
SELECT Combined,Combined.Date, Combined.[IP address], Combined.[Website URL], Combined.Country, Combined.Username, Combined.Browser, Combined.Template, Combined.Session, Combined.Language, Combined.Referrer, Combined.Profile, Combined.Product
FROM Combined;

what have i done wrong here as i cant see what ive missed.
 
Your Insert Into has 12 Fields and your Select 13! I think you should delete the red one
Code:
INSERT INTO Combined1( Combined1.Date, Combined1.[IP address], Combined1.[Website URL], Combined1.Country, Combined1.Username, Combined1.Browser, Combined1.Template, Combined1.Session, Combined1.Language, Combined1.Referrer, Combined1.Profile, Combined1.Product ) IN 'C:\Weblog1\Weblog2\page_views.mdb'
SELECT [red]Combined[/red],Combined.Date, Combined.[IP address], Combined.[Website URL], Combined.Country, Combined.Username, Combined.Browser, Combined.Template, Combined.Session, Combined.Language, Combined.Referrer, Combined.Profile, Combined.Product
FROM Combined;
If both tables have the same structure you could also use a shorter version....
Code:
Insert Into Combined1
Select Combined.*
From Combined;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top