>-----Original Message----- >From: Mindaugas Kavaliauskas [mailto:dbto...@dbtopas.lt] >Sent: Friday, October 16, 2009 5:09 PM >To: Harbour Project Main Developer List. >Subject: Re: [Harbour] SqlMix and dbcreated > >Hi, > >> I have one question: >> rdd_info does connect to a particular database. >> How to make a call simultaneously to 2 or 3 bases, and juggle >> connections (Oracle, SQLServer and DB2). >> Now I have to copy the DBF file and do the other, a new connection. >> When I need to read the previous database, I do a new connection. > > >Yes, of cause. You just have to pass a connection parameter to >RDDINFO(), DBUSEAREA(), etc. Or select current connections >using RDDI_CONNECTION.
Do not understand :( For example I have 2 databases : 1 - oracle 2 - sqlserwer And now : ? Rdd_info( 1001, { "ODBC", "DSN=TO_ORACLE;SERVER=KANZ;PWD=pass;UID=schema" }, 'SQLMIX' ) dbUserea( .t., 'SQLMIX', 'select * from posrednik', 'POSREDNIK') // here I can use more tables or selects from tis RDBMS // now to sqlserver ? RDDINFO( 1001, { "ODBC", "Driver={SQL Server};Server=MSSQL.AliasDatabases;Database=NAMEofDATABASEI;Trusted_Con nection=yes;" }, 'SQLMIX' ) dbUserea( .t., 'SQLMIX', 'select * from klient', 'KLIENT') // and now, when I will read from oracle, I make : ? Rdd_info( 1001, { "ODBC", "DSN=KAN;SERVER=KANZ;PWD=pass;UID=schema" }, 'SQLMIX' ) dbUserea( .t., 'SQLMIX', 'select * from adresy', 'ADRESY') But connect to this dbms was created earlier. How can I reuse it ? And another problem :( Now without problems create I tables, but this code : m := posrednicy->( fcount()) while !posrednicy->( Eof()) insert := "INSERT INTO posrednik values (" for n := 1 To m var := posrednicy->( FieldGet( n)) typ := ValType( var) do case // przypadki case typ == 'N' ; insert += NtoS( var) case typ == 'D' ; insert += if( empty( var), 'Null', "'" + TransForm( DtoS( var), '@R 9999-99-99') + "'") case typ == 'C' ; insert += "'" + StrTran( Trim( var), ',') + "'" end if n == m ; insert += ')' else ; insert += ',' end next RDDINFO(RDDI_EXECUTE, insert) RDDINFO(RDDI_EXECUTE, "commit") posrednicy->( dbSkip( 1)) end Are not inserted records. Commands caught from app, f.e.: INSERT INTO posrednik values (0,0,'','','','91020403469','','','',Null,'','','','','','') Are corretctly executed from toad or another tools, and records are inserted. I do not know where to find the cause :( Regards, Marek Horodyski _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour