Hello,

Thank you for your reply, I tried your solution and it was working fine. But 
the problem I found that the field name has been changed inside the database 
table with the added double quotes. What I was trying to do is to do is to 
solve it without changing the table field names.

 

>It's unclear to me what you are actually trying to achieve with 
>your code but as you say

 

This code is for the user to build his own database tables and use the newly 
tables in conjunctions link with his available ERP solution. Hereby  what ever 
naming convention 'the user' want to follow he can do so. That the camel case 
letters may need to be more convenience specially when he want to use his new 
forms. Paradox solve this by making to names; Field Name, and Display Name. I 
don't want him to make double work on creating his own tables and forms.

 

i.e.1 thank you again for being  professional. J

i.e.2 If my idea was unclear pls contact me at my email and I'll be glad to 
share it with you.

My regards.

 

 


Dave Sellers <[EMAIL PROTECTED]> wrote:Alright, let's just say something got 
lost in translation....

I tried your code and reproduced your error although you only gave us 
part of it - it goes on to say invalid use of keyword 'Name'.  There's a 
big clue there.

Call me stubborn if you like but I thought I'd try enclosing "Emp Name" 
in double quotes and hey, the error went away.  Why LiveQuery or 
DefaultExpression make a difference I really couldn't say - I'm no 
paradox expert, I haven't touched it for years.

Here's your slightly modified code (double quotes to get rid of the 
error).  It's unclear to me what you are actually trying to achieve with 
your code but as you say, the only thing you're interested in is the 
error message so we won't concern ourselves with functionality.

So did you actually try my original suggestion before dismissing it as 
unworthy of consideration?  Please humour me and try pasting the code 
below into your application and let me know what result you get.  If it 
still produces the error then  maybe we have an issue with versions of 
Delphi, paradox or something else. 

Dave
PS IMHO it's generally a good idea to avoid spaces in field names, 
you'll save yourself a lot of time debugging SQL that doesn't work.

procedure TForm1.Button1Click(Sender: TObject);
Var
  MyQuery     : TQuery;
  MyTable  :TTable;
begin
  MyTable := Ttable.Create(Form1);
  With MyTable Do
  begin
    TableName := 'c:\Table1.db';
    TableType := ttParadox;
    FieldDefs.Add('"Emp Name"', ftString, 20, False);
    CreateTable;
    free;
  end;
  MyQuery := TQuery.Create(Form1);
    With MyQuery Do
    Begin
      close;
      RequestLive := True;
      SQL.Clear;
      Sql.Text := 'Select * from ''c:\Table1.db''';
    End;
   DataSource1.DataSet := MyQuery;
   With TStringField.Create(Application) Do
      Begin
       FieldName := '"Emp Name"';
       Size := 20;
       DataSet := MyQuery;
       DefaultExpression :='''Name''';
      end;
    MyQuery.open;
end;


Loay Habash wrote:

>Ok,
>
>Lets forget that every one can be 'rude person' in his own way. The subject 
>was the error message not any thing else. It was a challenge for me and 
>thought that somebody how like to think will like it.
>
>Any way thank you
>
>
>David Smith <[EMAIL PROTECTED]> wrote:Maybe it's not too much work but who 
>would do free
>work for such a rude person? 
>
>--- Loay Habash <[EMAIL PROTECTED]> wrote:
>
>  
>
>>thank you for nothing. 
>>is it much work you will do it for me ?
>>Thank you for reminding me that it is my problem, I
>>thought it is not my problem :(
>>
>>
>>Dave Sellers <[EMAIL PROTECTED]> wrote:
>>Sorry, no time do that much work for you.  You're
>>the one with the 
>>problem and the code in place to try any hints in
>>seconds.
>>
>>I guess you're on your own now.  You can try as many
>>times as you need.
>>
>>Good luck
>>
>>Loay Habash wrote:
>>
>>    
>>
>>>Yes, thank you for your fast replay.
>>>
>>>
>>>
>>>I said it is hard question. Please try your answers
>>>      
>>>
>>before sending them. J you didn't make it this time
>>but you can try again as many times you need.
>>    
>>
>>>Looking forward to get your smart answer.
>>>
>>>
>>>
>>>
>>>Dave Sellers <[EMAIL PROTECTED]>
>>>      
>>>
>>wrote:Paradox likes field names containing spaces to
>>be enclosed in - hmmm, 
>>    
>>
>>>memory fails - try square brackets or double
>>>      
>>>
>>quotes....
>>    
>>
>>>Loay Habash wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Hello Every body:
>>>>
>>>>Do you like hard questions ????
>>>>See this one,.....
>>>>
>>>>If you put space at the fieldname you will get the
>>>>        
>>>>
>>"Preparation of field default faild" error ???
>>    
>>
>>>>if you name it as one word you will get no error.
>>>>If you did not use DefaultExpression for the field
>>>>        
>>>>
>>or RequestLive for the query you will get no error
>>what ever the field name is,..... Can I get any
>>Help.
>>    
>>
>>>>Var
>>>>MyQuery     : TQuery;
>>>>MyTable  :TTable;
>>>>begin
>>>>MyTable := Ttable.Create(Form1);
>>>>With MyTable Do
>>>>begin
>>>>  TableName := 'c:\Table1.db';
>>>>  TableType := ttParadox;
>>>>  FieldDefs.Add('Emp Name', ftString, 20, False);
>>>>  CreateTable;
>>>>  free;
>>>>end;
>>>>MyQuery := TQuery.Create(Form1);
>>>>  With MyQuery Do
>>>>  Begin
>>>>    close;
>>>>    RequestLive := True;
>>>>    SQL.Clear;
>>>>    Sql.Text := 'Select * from ''c:\Table1.db''';
>>>>  End;
>>>> DataSource1.DataSet := MyQuery;
>>>> With TStringField.Create(Application) Do
>>>>    Begin
>>>>     FieldName := 'Emp Name';
>>>>     Size := 20;
>>>>     DataSet := MyQuery;
>>>>     DefaultExpression :='''Name''';
>>>>    end;
>>>>  MyQuery.open;
>>>>end;
>>>>
>>>>
>>>>
>>>>Loay Habash, 
>>>>http://groups.yahoo.com/group/WeLoveYouAll/ 
>>>>http://profiles.yahoo.com/leohabash 
>>>>[EMAIL PROTECTED] 
>>>>Mobile: +966503322315
>>>>
>>>>          
>>>>---------------------------------
>>>>Start your day with Yahoo! - make it your home
>>>>        
>>>>
>>page 
>>    
>>
>>>>[Non-text portions of this message have been
>>>>        
>>>>
>>removed]
>>    
>>
>>>>
>>>>
>>>>        
>>>>
>>>-----------------------------------------------------
>>>      
>>>
>>>>Home page:
>>>>        
>>>>
>>http://groups.yahoo.com/group/delphi-en/
>>    
>>
>>>>To unsubscribe:
>>>>        
>>>>
>>[EMAIL PROTECTED] 
>>    
>>
>>>>Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>
>>>      
>>>
>>-----------------------------------------------------
>>    
>>
>>>Home page: http://groups.yahoo.com/group/delphi-en/
>>>To unsubscribe:
>>>      
>>>
>>[EMAIL PROTECTED] 
>>    
>>
>>>
>>>SPONSORED LINKS 
>>>Basic programming language C programming language
>>>      
>>>
>>Computer programming languages The c programming
>>language C programming language List of programming
>>languages 
>>    
>>
>>>---------------------------------
>>>YAHOO! GROUPS LINKS 
>>>
>>>
>>>   Visit your group "delphi-en" on the web.
>>> 
>>>   To unsubscribe from this group, send an email
>>>      
>>>
>>to:
>>    
>>
>>>[EMAIL PROTECTED]
>>> 
>>>   Your use of Yahoo! Groups is subject to the
>>>      
>>>
>>Yahoo! Terms of Service. 
>>    
>>
>>>---------------------------------
>>>
>>>
>>>
>>>
>>>
>>>Loay Habash, 
>>>http://groups.yahoo.com/group/WeLoveYouAll/ 
>>>http://profiles.yahoo.com/leohabash 
>>>[EMAIL PROTECTED] 
>>>Mobile: +966503322315
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>>>      
>>>
>>protection around 
>>    
>>
>>>http://mail.yahoo.com 
>>>
>>>[Non-text portions of this message have been
>>>      
>>>
>>removed]
>>    
>>
>>>
>>>
>>>      
>>>
>>-----------------------------------------------------
>>    
>>
>>>Home page: http://groups.yahoo.com/group/delphi-en/
>>>To unsubscribe:
>>>      
>>>
>>[EMAIL PROTECTED] 
>>    
>>
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>>
>>
>>    
>>
>-----------------------------------------------------
>  
>
>>Home page: http://groups.yahoo.com/group/delphi-en/
>>To unsubscribe:
>>[EMAIL PROTECTED] 
>>
>>
>>    
>>
>=== message truncated ===
>
>
>
>            
>____________________________________________________
>Start your day with Yahoo! - make it your home page 
>http://www.yahoo.com/r/hs 
>
>
>
>-----------------------------------------------------
>Home page: http://groups.yahoo.com/group/delphi-en/
>To unsubscribe: [EMAIL PROTECTED] 
>
>
>
>---------------------------------
>YAHOO! GROUPS LINKS 
>
>
>    Visit your group "delphi-en" on the web.
>  
>    To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>  
>    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>
>
>---------------------------------
>
>
>
>
>
>Loay Habash, 
>http://groups.yahoo.com/group/WeLoveYouAll/ 
>http://profiles.yahoo.com/leohabash 
>[EMAIL PROTECTED] 
>Mobile: +966503322315
>
>            
>---------------------------------
> Start your day with Yahoo! - make it your home page 
>
>[Non-text portions of this message have been removed]
>
>
>
>
>-----------------------------------------------------
>Home page: http://groups.yahoo.com/group/delphi-en/
>To unsubscribe: [EMAIL PROTECTED] 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 



SPONSORED LINKS 
Basic programming language C programming language Computer programming 
languages The c programming language C programming language List of programming 
languages 

---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "delphi-en" on the web.
  
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------




                
---------------------------------
 Start your day with Yahoo! - make it your home page 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to