BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Packing DBF tables when using ADO

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases
View previous topic :: View next topic  
Author Message
Sonnich
Guest





PostPosted: Tue Aug 23, 2005 3:23 pm    Post subject: Packing DBF tables when using ADO Reply with quote



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





PostPosted: Tue Aug 23, 2005 4:29 pm    Post subject: Re: Packing DBF tables when using ADO Reply with quote




"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 Smile

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.