Brad Corbett


ok, I not a Foxpro Wizard and Ican't figure this out

I get a "Syntax Error" msg when I try and run this from VB.net.

Not the most Descriptive Message. I can't see anything wrong with this. Any helpp will be appreciated.

Insert Into MWDUS Values (Date(2007,4,3),"685174",560907,.F.,.T.,"AK","","BARROW",

"INTREPID","2","11-19N-20W-2865FNL-1754FEL","11","19","N","20","W","2865","FNL","","1754",

"FEL","","","","","","","","","","","VER","","","","","","","","","","","","","","","","","","","","","","","","","","","","50-023-20036-","206-190","","","","OD",.T.,Date(2007,1,26),Date(2007,4,1),Date(1900,1,1),"ARCTIC SLOPE",

"","","","","","","","","",0,,,"EXPLORATORY","APRV","ASN","",-157.050630,71.013739,"","","","","","","");




Re: Fox Pro SynTax Error

dni


How is defined Insert Into





Re: Fox Pro SynTax Error

Naomi Nosonovsky

You can not omit fields like you did after 0. In other words, you need to specify all values after 0 and not just put a comma.




Re: Fox Pro SynTax Error

Brad Corbett

That was it, Thankyou very much. I've wasted a day on this.....





Re: Fox Pro SynTax Error

Naomi Nosonovsky

Glad to help.



Re: Fox Pro SynTax Error

CetinBasoz

You would waste another week on your next statement if you continue to do insert/update from .Net like that. Check OleDbParameter and OleDbCommand in help. Instead of hardcoding all values like that use parameters. If you'd pass only a few of the parameters and other fields do not accept nulls then first ExecuteNonQuery with an OleDbCommand where CommandText is "set null off".