Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Chris
  Where is Chris?
 
 North Carolina - United States
 Chris
 Tags
Subject: RE: SQL command examples
Thread ID: 155208 Message ID: 155214 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: .NET
Date: Thursday, December 27, 2007 10:57:48 PM         
   


> I could use a couple of sample sql insert commands so I'd know how to fill foxpro fields of varying types using sql from .net.
>
> To fill the foxpro character type field btn in the database c:\btn
> mycommand = "insert into c:\btn(btn) values ('3368675309')"
>
> Ok, now suppose I also want to fill a date field last_call -- what do I do?
> mycommand = "insert into c:\btn(btn, last_call) values ('3368675309', ??????)"
>
> What about a logical field say current.
> These 2 work
> mycommand = "insert into c:\btn(btn, current) values ('3368675309', 1)"
> mycommand = "insert into c:\btn(btn, current) values ('3368675309', .T.)"
> I wonder why this doesn't
> mycommand = "insert into c:\btn(btn, current) values ('3368675309', " & True & ")"

Chris,
Why don't you simply use parameters and use corresponding .Net datatypes (DateTime for date/datetime, bool for logical ...).

PS:

mycommand = "insert into c:\btn(btn, current) values ('3368675309', " & True & ")"

should yiled a string like

insert into c:\btn(btn, current) values ('3368675309', True )


and VFP doesn't know what True is.

Check https://www.foxite.com/archives/vfpole-dates-0000153532.htm

Cetin Basoz

ENTIRE THREAD

SQL command examples Posted by Chris @ 12/27/2007 8:38:59 PM
RE: SQL command examples Posted by Cetin Basoz @ 12/27/2007 10:57:48 PM
RE: SQL command examples Posted by Chris @ 12/28/2007 2:55:53 PM
RE: SQL command examples Posted by Cetin Basoz @ 12/28/2007 4:19:09 PM