📄 faq.htm
字号:
<html>
<head>
<title>Absolute DB FAQ</title>
</head>
<!--#include virtual="/inc/header.php"-->
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#FFFFFF">
<tr>
<td align="left">
<span style="font-family:Helvetica,Arial; font-size:12pt; color:#000000"><b>Absolute DB FAQ
<br>
</b></span>
</td>
<td align="right">
<font face="Arial" size="2">
<a href="tabsdataset.htm">Previous</a>
<a href="overview.htm">Top</a>
<a href="maximumcapacityspecification.htm">Next</a>
</font>
</td>
</tr>
</table>
<br><br>
<span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>
<br>
1. How to speedup bulk inserts?
<br>
</b>
<br>
You can speedup bulk inserts by using transactions:
<br>
AbsDB.StartTransaction;
<br>
...insert data...
<br>
AbsDB.Commit(False);
<br>
<br>
<br>
<b>2. How to perform SELECT from multiple databases?
<br>
</b>
<br>
Use database name prefix with the table name to specify a table from another database.
<br>
table_reference ::= "databasefilename.abs".table_name
<br>
Example:
<br>
SELECT * from "c:\Demos\Data\DBFishes.abs".biolife
<br>
<br>
For in-memory tables, precede table name with the MEMORY keyword:
<br>
select * from MEMORY mytable
<br>
<br>
<br>
<b>3. I have this kind of problem during the installation of Absolute Database:
<br>
the system returns this message "Setup was unable to find IDE (Delphi or C++ Builder)"</b>
<br>
<br>
The Absolute Database is designed to be used primarily by Borland Delphi or C++ Builder developers. If you haven't one of these programs installed on your computer, you'll not be able to use the Absolute DB with its full power.
<br>
<br>
<br>
<b>4. When I try to compile your demo applications or blank form with your components, I get compiler error:
<br>
[Fatal Error] File not found: 'C:\Program Files\ComponentAce\AbsoluteDatabase\Lib\Delphi
<br>
7\ABSMain.pas'</b>
<br>
<br>
Most probably you use Trial or Personal edition of Delphi. These editions are not supported by Absolute DB. This error occurs because the ABSMain.dcu was created using commercial Delphi edition, and your edition tries to recompile ABSMain but the source (.pas) file cannot be found as the Personal version of Absolute DB is distributed without source code.
<br>
<br>
<br>
<b>5. Running the following code I get the following exception message:
<br>
"Error creating table handle - Native error: 2001"
<br>
void __fastcall TForm1::Button1Click(TObject *Sender)
<br>
{
<br>
Query->SQL->Text = "INSERT INTO friends(name) VALUES ('Joseph') " ;
<br>
Query->Open();
<br>
}
<br>
</b>
<br>
INSERT, UPDATE, and other queries which don't return any data must be called by
<br>
TABSQuery->ExecSQL() method instead of TABSQuery->Open().
<br>
<br>
<br>
<b>6. If client computer crashes, the database file will be corrupted?
<br>
</b>
<br>
Database file will be corrupted only if the client computer will crash during writing to the database file. This problem has a few chances to happen, but in this case, the database will be auto-repaired on the next database opening.
<br>
If application attempts to open a database file for the first time and data corruption is detected, then TAbsDatabase.OnNeedRepair event is fired, so you can do necessary actions to inform user about repair. Database file could be also repaired manually using TABSDatabase.RepairDatabase.
<br>
<br>
<br>
<b>7. Trying to execute a query like
<br>
<br>
select * from MyTable order by Field1 group by Field2
<br>
<br>
I got an error: "End of SQL command expected, but 'group' found at line 3, column 1 - Native error: 20260"</b>
<br>
<br>
The ORDER BY clause must be placed after GROUP BY:
<br>
<br>
SELECT
<br>
...
<br>
FROM from_item [, ...]
<br>
[ WHERE condition ]
<br>
[ GROUP BY { column_name | expression } [, ...] ]
<br>
...
<br>
[ ORDER BY { unsigned_integer | column_name } [ ASC | DESC ] [, ...] ]
<br>
<br>
<br>
<b>8. Will it be difficult to convert my BDE app to Absolute ?
<br>
</b>
<br>
No. Absolute is fully compatible with BDE components, so you'll just need to replace TTable, TQuery, TDatabase, TSession components with TABSTable, TABSQuery and so on. See <span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><a href=howtomigratefromthebde.htm>How to Migrate from the BDE</a></span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"> for more details.
<br>
<br>
<br>
<b>9. Which Query Builder can I use to work with Absolute Database?
<br>
</b>
<br>
It can be found here: <span style="font-family:Times New Roman; font-size:12pt; color:#0000FF"><u><span class="weblink"><a href="http://www.korzh.com/delphi/sq/" target="_blank">http://www.korzh.com/delphi/sq/</a></span></u></span></span><span style="font-family:Times New Roman; font-size:12pt; color:#000000">
<br>
<br>
<b>
<br>
10. The query
<br>
<br>
select group, data from table
<br>
<br>
seems to be correct but when I run it, I get the error
<br>
<br>
"Expression expected, but 'group' found".
<br>
<br>
Is it because "group" is reserved word? What I can do to avoid this error?</b>
<br>
<br>
Yes, the error occurs as GROUP is a reserved word. To avoid this error, enclose field name with the square brackets:
<br>
<br>
select [group],data from table
<br>
<br>
<b>
<br>
11. You labeled yourself as a Borland Technology Partner. What does it means to us?
<br>
</b>
<br>
It means for you is that our company will have early access to Delphi Betas, so we can provide smooth updates when the next version of Delphi is released.
<br>
<br>
<b>
<br>
12. Has anyone developed a DADE interface for ReportBuilder yet?
<br>
</b>
<br>
Yes, you can download it from <span style="font-family:Times New Roman; font-size:12pt; color:#0000FF"><u><span class="weblink"><a href="http://www.componentace.com/AbsoluteDB_Addons.htm" target="_blank">http://www.componentace.com/AbsoluteDB_Addons.htm</a></span></u></span></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>
<br>
1</b><b>3</b><b>. How to set a value of a ftLargeInt field?
<br>
</b>
<br>
TLargeIntField(FieldByName('My_LargeInt_Field')).Value := MyLargeInt;.
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>
<br>
1</b><b>4</b><b>. How to uninstall Absolute DB?
<br>
</b>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Times New Roman; font-size:12pt; color:#000000">1.</span></span></td><td><span style="font-family:Times New Roman; font-size:12pt; color:#000000">Delete the Absolute Database folder completely
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="28"><span style="font-family:Times New Roman; font-size:12pt; color:#000000">2.</span></td><td><span style="font-family:Times New Roman; font-size:12pt; color:#000000">Delete all vclAbsDB*.* files from Windows\system32 folder.
<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Times New Roman; font-size:12pt; color:#000000"></span></td><td></td></tr></table><span style="font-family:Times New Roman; font-size:12pt; color:#000000"></span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>
<br>
1</b><b>5</b><b>. </b><b>O</b><b>n this computer there are several users, the Delphi is installed only </b><b>by</b><b> my
<br>
user. I failed as I tried to install the Absolute database with another user.
<br>
</b>
<br>
Please install Absolute DB with the user which have Delphi installed..
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>
<br>
1</b><b>6</b><b>. How can I check whether the database is opened by only one user or more?
<br>
</b>
<br>
Please use the following code:
<br>
<br>
ABSDatabase1.Close;
<br>
ABSDatabase1.Exclusive := True;
<br>
try
<br>
ABSDatabase1.Open;
<br>
// sole user mode
<br>
ShowMessage('single user');
<br>
except
<br>
// another users are connected
<br>
ShowMessage('multiuser mode');
<br>
end;.
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>
<br>
1</b><b>7</b><b>. Both TCloseAction & TCompressionAlgorithm use "caNone" and this is confusing the
<br>
complier, how to solve this problem?
<br>
</b>
<br>
In this case you'll need to explicitly specify the unit where a constant is
<br>
defined by using the name of the unit preceding the constant.
<br>
The unit name is separated by a dot from the identifier:
<br>
// compression algorithm
<br>
AdvFieldDef.BlobCompressionAlgorithm := ABSMain.caNone
<br>
// close action
<br>
Action := Forms.caNone
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>1</b><b>8</b><b>. What is the "primary key" for?
<br>
</b>
<br>
The primary key constraint specifies that a column may contain only unique
<br>
(non-duplicate), nonnull values. Technically, PRIMARY KEY is merely a
<br>
combination of UNIQUE and NOT NULL, but identifying a set of columns as primary
<br>
key also implies that other tables may rely on this set of columns as a unique
<br>
identifier for rows.
<br>
Only one primary key can be specified for a table, whether as a column
<br>
constraint or a table constraint.
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>1</b><b>9</b><b>. What is the "unique key" for?
<br>
</b>
<br>
The UNIQUE constraint specifies that a column of a table may contain only unique
<br>
values.
<br>
For the purpose of a unique constraint, null values are considered equal.</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
<br>
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>20</b><b>. How do I speedup a query with a condition like WHERE Field1 = 'Value' OR Field2
<br>
= 'Value' ?
<br>
</b>
<br>
Absolute DB cannot use indexes for OR conditions. You can speedup your
<br>
query by creating indexes for each field and by using a UNION operator instead
<br>
of using OR condition:
<br>
<br>
SELECT ... WHERE table.f1 = 'Value'
<br>
UNION
<br>
SELECT ... WHERE table.f2 = 'Value'</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
<br>
<br>
</span><span style="font-family:Times New Roman; font-size:12pt; color:#000000"><b>21</b><b>. I would like to know if in absolute database exists function that it
<br>
returns number from days between dates?
<br>
</b>
<br>
You can use a query like the following to get the number of days
<br>
between two dates:
<br>
<br>
SELECT ABS(CAST(d1 as INTEGER) - CAST(d2 AS INTEGER)) FROM table1.
<br>
<br>
where d2 and d1 are date/datetime fields.
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
</span></span>
<!--#include virtual="/inc/footer.php"-->
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -