Connecting to two servers
- From: F Alvarado <f.alvarado@xxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Jul 2008 11:46:33 -0600
I need to access two tables in two different servers (MS SQL Server 2005) and append data from one table to the second one.
I'm using two ADOConnections, each one pointing to a different server/database,
one ADOTable (TADODestination)linked to the destination Server/Database/Table ADOConnection to receive the records and a ADOQuery (QADOSource) linked to the source server/database, but I receive Error "Parameter object improperly defined, inconsistent or incomplete information was provided"
procedure TOEETestF1.GoClick(Sender: TObject);
begin
TADODestination.Active := False;
TADODestination.TableName := eTable.Text;
TADODestination.Active := True;
QADOSource.SQL.Add('INSERT INTO TADODestination SELECT * FROM SourceTable');
QADOSource.Prepared := True;
QADOSource.ExecSQL;
QADOSource.Prepared := False;
end;
Apparently the TADODestination Table is not valid in the ADOQuery context...
Any ideas?
Regards
Francisco Alvarado
.
- Follow-Ups:
- Re: Connecting to two servers
- From: Joachim Uersfeld
- Re: Connecting to two servers
- From: Helmut Woess
- Re: Connecting to two servers
- Prev by Date: Re: TADOTable Lookup Field :: EOleException
- Next by Date: Re: Connecting to two servers
- Previous by thread: Trap "database does not exist" Exception
- Next by thread: Re: Connecting to two servers
- Index(es):