Hi all,
I have two tables from two different databases.
For example:
Table: Articles1 - Database: db1
Attributes: id date headline text
Table: Articles2 - Database: db2
Attributes: id date headline text
Now i want to make an article feed with articles from both tables combined and sorted by date. From my knowledge it isnt possible to make queries across two different databases?
What can i do ? Make a temporary table and insert alle articles and sort and print? Make a cronjob getting all articles?
Btw. im doing it with MS SQL and ASP.
Thanks in advance
After i receieved som answers i'm trying to do this:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Provider;Data Source=myDataSource;Initial Catalog=Catalog1;User Id=myID;Password=myPassword1;"
Set Conn2 = Server.CreateObject("ADODB.Connection")
Conn2.Open "Provider=Provider;Data Source=myDataSource;Initial Catalog=Catalog2;User Id=myID;Password=myPassword2;"
strSQL = "SELECT id, datetime, headline, text "&_
"FROM Conn.dbo.vArticles "&_
"UNION ALL "&_
"SELECT AutoID as id, Dato as datetime, Notat as headline, Notat as text "&_
"FROM Conn2.dbo.Notat WHERE NotatTypeID = '5'"
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, Conn
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
But getting some errors.