 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sonnich Guest
|
Posted: Tue Aug 23, 2005 3:23 pm Post subject: Packing DBF tables when using ADO |
|
|
I have problems packing dbase table, I get an error:
[Microsoft][ODBC dBase Driver] Invalid SQL statement; expected
'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'
I have been looking into it, and did not find much. Does anyone know
about this?
The error occures on the execute statement.
I found a number pages describing this, but none explaining the
situation I have.
Code:
CoInitialize(nil);
connection := CreateOleObject('ADODB.Connection') as _Connection;
connection.Open('Data Source='+sDatabaseName, sUsername, sPassword, 0);
The solution one....
connection.Execute('Set Exclusive On', Ai, adCmdText);
Solution two:
cmd1 := CreateOleObject('ADODB.Command') as _Command;
cmd1.CommandType := adCmdText;
cmd1.Set_ActiveConnection(connection);
cmd1.CommandText := 'Set Exclusive On';
cmd1.Execute(Ai, Ai2, adCmdText);
{ rest... for both }
cmd1.CommandText := 'Pack Test.dbf';
PS: is there are a way to operate paradox tables? I seem to have
problems inserting/editing data once there is more than one row in a
table :-)
|
|
| Back to top |
|
 |
pr Guest
|
Posted: Tue Aug 23, 2005 4:29 pm Post subject: Re: Packing DBF tables when using ADO |
|
|
"Sonnich" <sonnich.jensen (AT) elektrobit (DOT) com> wrote
| Quote: |
PS: is there are a way to operate paradox tables? I seem to have
problems inserting/editing data once there is more than one row in a
table
|
If there is a problem with inserting a second record then it
is probably a problem with the primary key where each
value must be unique.
PR
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|