Hi:
I need to copy a table(india) in a database(new.mdb) to annother database(news.mdb).
Any help please?
Thanks
Printable View
Hi:
I need to copy a table(india) in a database(new.mdb) to annother database(news.mdb).
Any help please?
Thanks
It might look something like this...
VB Code:
INSERT INTO india [IN news.mdb] SELECT india.* FROM india
This maybe work,but if I have these 2 databases in a diferents paths?
You just have to set their path.
yes ok...I have to set their path,but I'm a litlle confused here because I have two databases and I just have one instruction...wich database I must set?
Can you post a little piece of code to show your point of view?
Thanks
Provide me the path's of those two database then perhaps I could code it for you. :)
hi:
The paths are:
source path - c:\program files\exp\new.mdb
destination Path - c:\program files\dali\news.mdb
Table with all records to copy from the source path - india
table for destination path - india
note:The databases are equals...they have the same tables,everything is equal...the diference is the path!
Thanks
Try this...
VB Code:
'reference microsoft ActiveX Data Objects Dim adoConnection As ADODB.Connection Set adoConnection = New ADODB.Connection adoConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\program files\exp\new.mdb" adoConnection.Execute "INSERT INTO india [IN 'c:\program files\dali\news.mdb'] SELECT india.* FROM india"
hi:
thanks for your reply!
I have convert the code for my reality and I got this error:
Run time error '3134'
Syntax error in INSERT INTO statement
3Code:
Dim db As Database
Set db = Workspaces(0).OpenDatabase("c:\program files\exp\new.mdb")
db.Execute "INSERT INTO india [IN 'c:\program files\dali\news.mdb'] SELECT india.* FROM india"
Thanks
This should work...
VB Code:
Dim db As Database Set db = Workspaces(0).OpenDatabase("c:\program files\exp\new.mdb") db.Execute "INSERT INTO india IN 'c:\program files\dali\news.mdb' SELECT india.* FROM india"
thanks for your help...now the code work very well
Glad it worked now! :)
Dee-u do you have any idea what the syntax would be when both databases are password protected?Quote:
Originally Posted by dee-u