Loay Habash wrote:

>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.
>  
>
Ah that's not quite what was intended or expected.  There IS a way of 
including spaces in field names if you create your table using a SQL 
(DDL) statement:

create table MyTable
(ID INTEGER,
 MyTable ."Emp Name" VARCHAR(50) )

There MAY also be a way with your table creation method but I don't 
know.  Note using the SQL method above that you not only have to enclose 
the field name with quotes but precede it with the table name (!) - I 
don't know why but it seems you do.  Having set this as your SQL text in 
your query you will need to use the ExecSQL method instead of Open. 
There are undoubtedly MUCH better ways of doing this if you know your 
way around Paradox but I don't and this APPEARS to work.  You should 
also be able to give a field a default value here too but it seems 
paradox is a little unusual in this area too...

>>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 still think you should not use spaces in field names. Could you not 
code it so that what the user types in is the display name and you 
create the field name from it by replacing spaces with underscores (_)?  
If you disallowed them from using the underscore themselves you could 
always work backwards from the field name to get your display name at 
run time.  Alternatively create another table where you store display 
names against field names.....  I don't know, I'm just making 
suggestions - it's up to you to find the solution that best suits you, 
that's the nature of the business.  Good luck

> 
>
>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]
>
>
>
>
>-----------------------------------------------------
>Home page: http://groups.yahoo.com/group/delphi-en/
>To unsubscribe: [EMAIL PROTECTED] 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/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