I am coding in Delphi, using a TADOConnection to access ODBC compliant databases.
How do I copy a database leaving the new copy on the same database server?
And how do I rename? (I suppose I could copy & delete the original - if I knew how to copy).
ODBC does not provide for the copying or creating databases. That is a technology-specific (specific to the RDBMS) facility. The closest you can get is by creating and populating (copying) tables.
The only way you could do it would be to issue a db-specific command via an ODBC connection but for that we would have to know exactly what type of database you're using.
Are you using ODBC drivers, or ADO providers? If the later, you can look into the ADOX library, which provides vendor neutral support for working with the structure of databases. I don't know myself whether it supports operations on the entire database.
Related
I am working on a research domain called knowledge managment and i am using neo4j.
I want to link my neo4j base with other database that requires physical data storage (PostgreSQL, MySQL...). Is this possible?
In general sure, it depends on how you want to set up the linking.
Perhaps you can detail your use-case more?
Normally people sync data between other datastores and Neo4j e.g. by triggering updates or polling.
For Postgres there is also a foreign data wrapper.
You can also use an event-sourced system, where data is written to your relational databases and relationships also to Neo4j. (also)
I am using tiny_tds for connecting to remote database, which is only used for MySQL and Sql server. Is their is any other gem available which can access any vendor database?
You're not understanding how database access works.
We use a driver to talk to a database. The database vendors have different protocols that are used to connect, so a driver handles that.
Above that layer we'd have an API that talks to the driver. That'd be something like DBI, which knows how to talk to different drivers. We still have to write using the query language of the database but DBI gives us some advantages. It's a pain to convert from one database to another, because usually all the queries change and the inconsistencies between "standards" show up.
Above that layer we'd have something like ActiveRecord or Sequel, which are ORMs, and are mostly DBM agnostic. They allow us to use a consistent language to define our connections to databases, create queries and handle interactions. If we want to talk to a different database manager, we install the driver, change the connection string, and the rest should work.
This is a huge time savings and a "very good thing". You can use SQLite for your proof-of-concepts, and something like PostgreSQL, MySQL, or Oracle for your production system, without changing queries. Only the DSN/connection string changes usually.
Read through Sequel's "Connecting to a database" document to get an idea what ORMs can do, along with "Sequel: The Database Toolkit for Ruby" and "Cheat Sheet" for an idea what Sequel can do.
I mainly want to use advantage to be able to access Fox tables larger than 2 gig. My programs are simple and are run from the command window.
I have Adv Data Archetect installed and have the ODBC driver installed.
I'm not very knowledgeable with connections, etc.
Can someone explain to me, provide a link or provide the code that I would need to be able to use and create 2 gig + tables.
Thanks
I cannot tell from the OP what you have actually done, but it sounds like you are expecting to be able to use an ODBC driver with an existing Visual FoxPro application without changing the application from the direct table access. That is not possible.
Here is a link to a screencast showing an example of using ODBC to get to a table that is over the 2GB limit. If I recall correctly, it shows how to use views to access the data; doing it that way can minimize the number of changes you need to make. More information about remote views can be found here.
You can also use ODBC "directly" with SQL pass through statements. It is also possible to use OLE DB with cursor adapters if you prefer that over ODBC.
In my application i have to read data from a CSV file. I want to use Microsoft Text Driver or Microsoft.Jet.OLEDB.4.0.
I am confused between the two. Which one should i opt for?
These are more or less the same thing in that they both use Jet
However, one is for OLE DB and one for ODBC, you might like to read OLE DB for the ODBC Programmer
I am looking at the Developer Express Quantum Grid example 'IssueList' which is a useful bug reporting and tracking application that's almost ready to go out of the box. It uses a TDatabase component with several paradox (.db) tables.
Is it simple to rejig the TDatabase settings to use a database on a shared machine so that several of us can access it together across the network? If so, what would be the steps needed please?
This TI describes the settings involved for sharing Paradox databases on a network.
In your configuration you need to set the working directory and private directory correctly.
Often it is easier not to use aliases for this, but perform all the settings in your TDatabase.Parameters property and your TSession.
The working directory must be the same path (sharename, drive letter) for all users.
The private directory must be different for all users.
Here are two links that explain some of the defails you need in more detail:
Building one and two tiered apps
Managing Database Sessions
--jeroen