On Mon, 22 May 2017, PICCORO McKAY Lenz wrote: > umm usefully, but the source its odbc.. was my faul... > > in any case, there's posible to cpy between results object of differents > connections? that the right quiestion! >
Ok, after I formulated my answer, I can see how you may want to use Gambas for this task. Assume you have hSrc and hDst two Connections -- hSrc is the source database and hDst is the destination database. The DB types don't matter! I would do the conversion in two stages: 1. Copy the database users (Connection.Users), then the databases (Connection.Databases) and after that the table schemas (Connection.Tables) for each database. I don't think you can expect to transfer anything else like permissions because it is not supported by the gb.db interface (sqlite doesn't even support users). You can use the gb.db objects for this, e.g. to copy the schema of a database table, you get the corresponding Table object and iterate through its Fields member to get all the fields. Luckily the field types are db.String, db.Integer, etc., i.e. *Gambas* constants. You can easily transfer this common representation of the table schema to your destination database. 2. Copy all the records. hSrc.Find(tablename) (or so) gives you all the records in the given table. Recreate all the records in the appropriate destination database table, using hDst.Create(tablename). I'm reasonably sure that there is no less manual way. But beware that you might run into problems of all thinkable kinds, e.g. with auto-increment fields which you may or may not be allowed to set on your own when you create a record, or maybe one database type stores milliseconds together with a date while the other is incapable of that. What do I know? Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user