Question:
At client, how can I get the IP address or host name of
itself.
Answer:
The following example requires using the Winsock API
encapsulated in WinSock.pas.
uses
WinSock;
procedure GetHostInfo(var Name, Address: string);
var
WSAData: TWSAData;
HostEnt: PHostEnt;
begin
{ no error checking...}
WSAStartup(2, WSAData);
SetLength(Name, 255);
Gethostname(PChar(Name), 255);
SetLength(Name, StrLen(PChar(Name)));
HostEnt := gethostbyname(PChar(Name));
with HostEnt^ do
Address := Format('%d.%d.%d.%d',[
Byte(h_addr^[0]),
Byte(h_addr^[1]),
Byte(h_addr^[2]),
Byte(h_addr^[3])]);
WSACleanup;
end;
Question:
"External Exception C0000008" or "Access Violation" error with
2.3.3 SQL NET client: I get an Access Violation with Delphi 3
and an External Exception error with Delphi 2 when connecting
to an Oracle server when in Delphi's IDE or Turbo Debugger with
NT4. If I run the application alone, it executes correctly. How
do I get around the problem?
Answer:
Borland has determined that this is a problem with SQL NET
2.3.3. Oracle also recognizes this as a SQL NET problem. There
are a couple of workarounds:
Rename or remove the registry entry
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\OTRACE73
This is the solution that Oracle support recommends!
Start Oracle's Installer and remove the "Oracle Trace
collection Serveces 7.3.3.x.x"
Turn off Integrated Debugging in Delphi's IDE
Use an Oracle SQL NET that is older than 2.3.3
Question:
If I use TMidasConnection with the sockets (TCP/IP)
transport, can I still take advantage of OLE Enterprise load
balancing and fail over? Would I then have to install OLE
Enterprise on the client machines?
Answer:
You can take advantage of OLE Enterprise without installing
it on the clients machines. Just set up the server (the
machine running SCKTSRVR.EXE) as a OLE Enterprise client.
That way, when a request comes in from a real client,
SCKTSRVR will attempt to create the object, and OLE
Enterprise will intercept and provide the service.
Question:
When attempting a connection to Oracle using the BDE Oracle SQL Links driver, why am I getting the error, Vendor initialization failure: ORANT71.DLL, when the driver's Vendor Init parameter is set to ORA73.DLL [or ORA72.DLL]?
Answer:
The BDE always searches the path first for the DLL specified in the Vendor Init parameter and if that fails, the BDE searches, by default, for ORANT71.DLL. Thus the Vendor Init error means that the BDE failed to find and load the DLL you specified and ORANT71.DLL.
Question:
How does the socket server (\bin\Scktsrvr.exe) interact with
TMidasConnection?
Answer:
The socket server is something like a service that replaces
DCOM, but without the security. When a client application sets
Connected = True on a TMidasConnection, the socket server on the
server machine creates the remote data module. Then it takes
the IDispatch invoke and GetIDsOfNames methods and marshals them
through the socket connection, using TCP/IP.
Question:
Using BLOB I/O an error, 'Memo Too Large' is returned. The error
is: General SQL Error: 7134, unmapped [text: text table and
table reference by the text pointer disagree.]. This is not a
problem if the table does not contain a unique index. In this
case all BLOB information is retrieved through the execution of
the query. What does this error mean and how can I resolve it?
Answer:
A fix to MSSQL server is available from Microsoft:
ftp://ftp.microsoft.com/bussys/sql/transfer/sql265i.exe - Intel Patch or
ftp://ftp.microsoft.com/bussys/sql/transfer/sql265a.exe - Alpha Patch
The password to use when extracting the files
is "6.50.265" (without the quotation marks). To extract with the password, the syntax is:
sql265i.exe -s6.50.265
Question:
Using MSSQL, or Sybase for that matter, why does a second simple
select query run more slowly than a preceding query.
Answer:
MS SQL has a "pending result sets" behavior where the 1st query
will only retrieve a small set of records (usually enough to
fill a grid or any other data aware controls), and there will be
a pending result set. The second query causes that pending
result set to be retrieved. This can be tested by closing the
first query before running the second or connecting each query
to a TDatabase. The BDE uses a "special" connection type that is
restricted to one per database connection. When a second query
is run within the same database connection, the BDE must fetch
and cache the previous query's records before starting the next
query.
Suggestions:
Close the first query before opening the second
Use multiple databases, one per query
Use a more restrictive where clause to limit the number of
records
Use a more restrictive domain result to retrieve only the
fields you need
Question:
I would like to have shortcut to close my application using ESC key.
Answer:
Here the simple program, unfortunatelly you need to activate the program first before close it using ESC Key.
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key = #27 then Close;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.KeyPreview := True;
end;
Question:
How is the Data property used typically in an application?
Answer:
Typically, it won't be used. It is how you can get the packet
as a variant array of bytes. You can also assign to it if you
receive a data packet from the server through some method
outside the IProvider interface.
Question:
What would cause error:
MS SQL Server error "17824 Unable to write to ListenOn
connection 'xxx', loginname 'xxx', hostname 'xxx'."
Answer:
PROBLEM:
After establishing a number of concurrent application connections
to the MS SQL Server the following error is encountered:
MS SQL Server error "17824 Unable to write to ListenOn
connection 'xxx', loginname 'xxx', hostname 'xxx'."
POSSIBLE CAUSE:
It is possible that the PROCEDURE CACHE percentage is set too
low. Please see your MS SQL Server documentation and NT Event
Viewer for more information on debugging network errors and
tuning your MS SQL Server's PROCEDURE CACHE.
Relevent SQL Server options:
MAX PROCEDURE CACHE ...
MAX WORKER THREADS
PROCEDURE CACHE
The procedure cache holds entries for each procedure and other
maintenance overhead.
Settings for the PROCEDURE CACHE include:
MAX PROCEDURE CACHE ACTIVE %
MAX PROCEDURE CACHE USED%
PROCEDURE CACHE USED%
MAX WORKER THREADS
The max worker threads option allows control over the number
of threads allocated to the user pool.
Question:
We want to add several records that contain auto-increment
fields to the ClientDataSet and then apply it to the remote
datamodule. The key field is an auto-increment field. How
is this done?
Answer:
You should be able to just leave this field blank on the
client application and it will be initialized when you call
ApplyUpdates to insert the record. If you need to see the
generated value back on the client, call Refresh.
Technical Information Document (TI3342)
"Index out of Date" ($2F02), "Blob has been modified" ($3302) errors with Paradox Tables
Product: BDE
Version: All
Platform: Windows 95, Windows NT, Windows 3.1
Index out Date ($2F02) is an error that occurs while using Paradox tables when the data in a table and a corresponding index is not consistent. In most cases (see
below for the one exception), short of malicious behavior such as renaming an index,
adding some data to the table, then renaming the index back, there is no programmatic way to cause this error to occur. There is no way to determine which index is out of date. All indexes must be recreated.
Blob has been modified ($3302) is an error that occurs when the Blob portion of the record contained in the .DB file has become inconsistent with the Blob portion in the .MB file. This could occur when the write to the .DB file was successful but the .MB file did not get updated, or visa-versa.
There are a few mechanisms to fix a table where these errors have occurred.
First try re-starting the application. It is possible that the BDE has become unstable and is reporting incorrect errors. Also try opening the table with a different application.
Use Paradox 7 or 8 to run the Table Repair utility. Please see original documentation for more information.
Run TUtility and rebuild the table. TUtility is an unsupported utility available for download from the Borland web site in the Utilities, programs and updates section.
Delete all indexes and recreate them (Index out Date ($2F02) error only). To do this you’ll need to know the structure of all your indexes (including primary) before recreating them, which means you need to know the structure of all indexes before the error occurs.
There are 8 known possible causes for this error.
Incorrectly setting the LOCAL SHARE property.
Most commonly this occurs via Peer-to-Peer networking. In this case the two different database engines are on two CPUs, even though they may be the same version. See BDE setup for Peer-To-Peer(Non-Dedicated) Networks for additional information on Peer-to-Peer setup.
Another condition is when two different database engines execute on the same CPU concurrently and access data locally. This would be true when any combination of following are used concurrently: The Paradox Engine, BDE 16 bit, BDE 32 bit, Paradox for DOS. In this case each engine must set LOCAL SHARE to TRUE. Note that if use two applications which both use the same database engine (for example: Delphi 3 and C++ Builder 3) concurrently are run LOCAL SHARE does not need to be set to TRUE. In this case, all locking and cached data is in a central memory pool which all BDE applications have access to. Also, if two different database engines use data remotely, LOCAL SHARE must be set to TRUE.
Code should be used at startup to check the setting of local share. Look at the DbiOpenCfgInfoList BDE API function call for more information.
Error transmitting data from the workstation to the server.
Most commonly, this occurs with bad network hardware (cable, card, hub, etc.). This has been determined to be a problem even though there were no other errors are detected in data transmission. To determine if this is the cause for your error, try eliminating one CPU at a time from using the data and see if the problem continues.
Bad VREDIR.VXD on any client accessing tables Windows 95 ONLY:
Several versions (notably 4.00.1113 and 4.00.1114) of the file VREDIR.VXD may need to be updated.
Reports have shown that using the original release of VREDIR.VXD (4.00.950) and a new release (4.00.1116) do not result in the errors "Blob has been modified" and/or "Index is out of date." If any one of the clients has a "bad" version of this device driver, the error can occur on any machine, not just the machine with the bad driver.
This error most likely occurs in 16Bit versions of the Borland Database Engine, although it still can occur in 32Bit versions.
For further information on the update of VREDIR.VXD, Please check the following Microsoft Articles: Q174371 and Q165403
For Windows 95 clients only, when using data on Windows NT: Add the following key in your registry: HKEY_LOCAL_MACHINESystemCurrentControlSetServicesVxDVredir
Then create the string or Binary Value (either one works) with a name of DiscardCacheonOpen and make it equal to 1.
Note that this an undocumented registry entry obtained from Microsoft. Questions on its functionality should be directed to Microsoft.
Problem with opportunistic locking Windows NT ONLY: Try turning off opportunistic locking in the Windows NT registry: See Microsoft Article Q129202
Note: Borland internal testing has not indicated this setting to be significant. However, some Borland customers have indicated this to solve the problem.
Improperly closing files such as due to loss of power or restarting a workstation or the server without closing files first may cause this problem. Paradox tables are not designed to withstand such behavior. If this is a possibility in your environment, we recommend you use a Client Server database that can recover from such conditions.
Extremely large numbers of indexes, especially involving Referential Integrity can cause this problem and especially when using Windows NT as the server. Borland recommends using a Client Server database under this condition. However, if you are using Windows NT as your server, switching to Novell Netware or Windows 95 as the server may resolve the problem as well.
The one programmatic way you can make this error occur is if you attempt to post a duplicate value to a unique, non-primary index at the same time you attempt to open the same table. This problem only occurs if local share is set to False and only occurs on local drives.
Unverified solutions
Windows 95 Only: Bring up the network properties screen on all Workstations and enter the netBEUI properties screen. On the advanced tab, make sure that "Set this protocol to be the default protocol" is checked.
Windows 95 Only: If the previous suggestion did not work, try removing the following protocols in order. Remove one at a time and then re-test your problem:
NETBIOS support for IPX/SPX-compatible Protocol
TCP/IP
IPX/SPX-compatible Protocol
If the problem disappears, attempt to add back in all protocols except for the last one that was taken out. Again, make sure netBEUI's default protocol check box is checked.
Windows NT Only used as a Workstation: On the Network Bindings page of the Network Properties, set the NetBEUI Protocol to be at the top of all services. The TCP/IP stack is known for having a lot of overhead that might cause timing problems. Since NT will send requests back in the same protocol as it is sent, changing the bindings on a NT machine used as a server will have no effect.
Other resources
The Delphi Magazine has a number of interesting articles on this subject as well. See www.itecuk.com/Delmag/Paradox.htm for details.
Question:
How do you make TClientDataSet sort on lookup or calculated
fields?
Answer:
In the fields editor, when creating a new field to be sorted
on, choose New Field from the context menu and choose
InternalCalc as the field type. Or if creating TFields in
code, make the TField.FieldKind fkInternalCalc instead of
fkCalc. fkInternalCalc is only available in ClientDataSets.





