InterBase C++builder Simple Example

Source: Internet
Author: User
Tags interbase odbc connection

InterBase C++builder example, the Internet to find a half-day did not find the right, the following is generally searchable articles, now organized:

Let me introduce a simple example (but very detailed) with Interbase―――c++builder.



Why Choose InterBase? Because it is easy to install, but the configuration and other aspects of the database is not much worse than the other. Choose C++builder, one is it easier to combine with InterBase, and its database programming is relatively simple and easy to learn.


   first, set up your own database (here, just create a database file, for the connection, behind the table to build it)
First creat a new database in InterBase's interbase Windows isql:
# Select Local Engine


# in the database column, you need to be careful: here to add the full path of the databases and database names, preferably with the extension *.gdb, for example: C:\database\mydatabase.gdb


#user NAME:SYSDBA
Password:masterkey (if you haven't changed)
Completed! You can go and see if there is a mydatabase.gdb in the c:\database.


Two, you can establish three kinds of BDE and interbase connection (aliases alias):

Method1. Direct connection with iblocal in BDE (simplest)

1. Start BDE Administrator;
2. In the left-hand listbox, select Iblocal, and choose Server Name:c:\database\ mydatabase.gdb, get it done!


Method2. InterBase Drive connection directly with BDE
1. Start the BDE Administrator;
2. In the left ListBox, right-click the popup menu, "New" command, then select the InterBase type, "OK"
3. The new connection has already appeared and can give it a name. The most important thing is to give it a choice of server name:c:\database\ Mydatabase.gdb
Done!


   Method3. ODBC connection (one of the most troublesome)
1. Open the ODBC Data Manager in the Control Panel and select the System DSN page; (If you're not using Win2000, just take a look at the top method, otherwise, "ODBC data Manager" should be in "Administrative Tools" in Control Panel)
2. Click the "Add" button to select "Intersolv Interbase ODBC Driver (*.gdb)", "Completed" in the ListBox in the popup dialog box;
3. In the dialog box that pops up:
Data Source name: Give the database a name (like a name for your dog), like MyDatabase.
Description: Can not add, or write what you want to say
Database name: Here to write the full name of the databases, including the complete path, here we write on c:\database\ mydatabase.gdb
4. The "OK" (others when you are free to add it)!
5. Now to BDE Administrator (SQL Explorer can also) look. You are not already seeing the "dog name" MyDatabase, if so, congratulations, connect done! can have a rest.


If you are not tired, do one thing (it will be convenient later):
Select MyDatabase, and write on the user name of the definition on the right: SYSDBA,

You don't have to hit user NAME when you log in, just hit the password.

Of the above three methods, 1 and 2 are used C++builder or Delphi to develop commonly used connection methods. Method 3 is also always VC + + development tools.

http://blog.csdn.net/usister/article/details/50401479

InterBase C++builder Simple Example

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.