<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I should add that there is another way to open Vdatabase in Xojo <div><br></div><div>the method to setup the db for the second way to access the db looks like this:</div><div><br></div><div><div> VDatabase.DateFormat = EVDateFormat.kMDY</div><div> mVDatabase.DateSep = "-"</div><div> mVDatabase.TimeSep = ":"</div><div> </div><div>Joseph</div><div><br></div><div><br><div><div>On Oct 12, 2013, at 6:08 PM, Joseph Morgan <<a href="mailto:joseph@checkos.com">joseph@checkos.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>After looking at my set-up I set up the database right after opening it (not necessarily after connecting to the server which happens earlier). Sorry I don't know how exactly the opening of the db happens in .net</div><div><br></div><div>I have a variable "mVdatabase" after opening the next line is my setup method "SetupVDB" </div><div><br></div><div><div>mVDatabase.Open( f )</div><div>SetupVDB//we can do any initial setups on the database before we use it</div></div><div><br></div><div><br></div><div>the setup method has the following lines of code:</div><div><br></div><div><div>dim setupstring as String = "SET PROPERTY DateTimeFormat,DateSeparator,TimeSeparator OF DATABASE TO 'kYMD','-',':';"</div><div>mVRBdatabase.SQLExecute(setupstring)</div><div>mVRBdatabase.Commit</div></div><div><br></div><div><br></div><div>if you search for "kYMD" on the wiki you should find the other constants that are for other formats.</div><div><br></div><div>Any time I have a field that uses a date in XOJO, I submit it as a string so it's likely to work similarly in .net</div><div><br></div><div>I hope this helps you!</div><div>Joseph</div><div><br></div><div><br><div><div>On Oct 12, 2013, at 5:39 PM, "Johnny Harris" <<a href="mailto:johnny@southshore.com">johnny@southshore.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<div dir="ltr">
<div dir="ltr">
<div style="font-size: 12pt; font-family: Calibri; ">
<div>Hi Joseph,</div>
<div> </div>
<div>I found in the docs:</div>
<div><br>SET PROPERTY DateTimeFormat and Set Property DateSeparator</div>
<div> </div>
<div>I tried executing both queries just after connecting and still get the same
results.</div>
<div> </div>
<div>Is that what you were referring to? If not maybe an example of your setup
string would help.</div>
<div> </div>
<div>It seems to me that the date value I’m trying to insert using parameters is
being converted to a string type when I add</div>
<div>it to the parameters array, which is a string array. I’m guessing since the
database is receiving it as a string it thinks it is invalid.</div>
<div> </div>
<div>I may be way off base also.</div>
<div> </div>
<div>Thanks For Helping.</div>
<div> </div>
<div>Johnny</div>
<div style="font-size: small; font-family: Calibri; font-weight: normal; font-style: normal; text-decoration: none; display: inline; ">
<div style="FONT: 10pt tahoma">
<div> </div>
<div style="BACKGROUND: #f5f5f5">
<div style="font-color: black"><b>From:</b> <a title="joseph@checkos.com" href="mailto:joseph@checkos.com">Joseph Morgan</a> </div>
<div><b>Sent:</b> Saturday, October 12, 2013 5:13 PM</div>
<div><b>To:</b> <a title="valentina@lists.macserve.net" href="mailto:valentina@lists.macserve.net">Valentina Developers</a> </div>
<div><b>Subject:</b> Re: SQL Insert Date</div></div></div>
<div> </div></div>
<div style="font-size: small; font-family: Calibri; font-weight: normal; font-style: normal; text-decoration: none; display: inline; ">
<div>It's been my experience that each time you open/connect to vserver, you
have to set up date format. I send an SQL execute right after connect that tells
the server to use the correct date format. Let me know if you need me to send
you the setup string that I use. </div>
<div> </div>
<div>Joseph </div>
<div><br>On Oct 12, 2013, at 5:08 PM, "Johnny Harris" <<a href="mailto:johnny@southshore.com">johnny@southshore.com</a>>
wrote:<br><br></div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div style="font-size: 12pt; font-family: Calibri; ">
<div>Update...</div>
<div> </div>
<div>I just tried the same query without parameter binding and it worked
OK.</div>
<div> </div>
<div>So I guess my question now is how to insert into a date field using
parameter binding?</div>
<div> </div>
<div>Regards,</div>
<div>Johnny Harris</div>
<div style="font-size: small; font-family: Calibri; font-weight: normal; font-style: normal; text-decoration: none; display: inline; ">
<div style="FONT: 10pt tahoma">
<div> </div>
<div style="BACKGROUND: #f5f5f5">
<div style="font-color: black"><b>From:</b> <a title="johnny@southshore.com" href="mailto:johnny@southshore.com">Johnny Harris</a> </div>
<div><b>Sent:</b> Saturday, October 12, 2013 5:05 PM</div>
<div><b>To:</b> <a title="valentina@lists.macserve.net" href="mailto:valentina@lists.macserve.net">Valentina Developers</a> </div>
<div><b>Subject:</b> SQL Insert Date</div></div></div>
<div> </div></div>
<div style="font-size: small; font-family: Calibri; font-weight: normal; font-style: normal; text-decoration: none; display: inline; ">
<div dir="ltr">
<div style="font-size: 12pt; font-family: Calibri; ">
<div>Hello everyone,</div>
<div> </div>
<div>I’m trying to insert a record and one of the fields is a date
field.</div>
<div> </div>
<div>I get the following error message:</div>
<div> </div>
<div>Date Value “10/12/2013” is invalid. Illegal symbol at “-1”
position."</div>
<div> </div>
<div>Would anyone happen to have any pointers for inserting dates?</div>
<div>I’m guessing the field is in the wrong format but the format for</div>
<div>the database is set to “MMDDYYYY” and the separator is “/”.</div>
<div> </div>
<div>I’m using .net and parameter binding.</div>
<div> </div>
<div>Regards,</div>
<div>Johnny Harris</div></div></div>
<hr>
_______________________________________________<br>Valentina mailing
list<br><a href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</a><br><a href="http://lists.macserve.net/mailman/listinfo/valentina">http://lists.macserve.net/mailman/listinfo/valentina</a><br></div></div></div></div></blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br><span>Valentina
mailing list</span><br><span><a href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</a></span><br><span><a href="http://lists.macserve.net/mailman/listinfo/valentina">http://lists.macserve.net/mailman/listinfo/valentina</a></span><br></div></blockquote><div>
<br class="webkit-block-placeholder"></div><hr>
_______________________________________________<br>Valentina mailing
list<br><a href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</a><br><a href="http://lists.macserve.net/mailman/listinfo/valentina">http://lists.macserve.net/mailman/listinfo/valentina</a><br></div></div></div></div>
_______________________________________________<br>Valentina mailing list<br><a href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</a><br><a href="http://lists.macserve.net/mailman/listinfo/valentina">http://lists.macserve.net/mailman/listinfo/valentina</a><br></blockquote></div><br></div></div>_______________________________________________<br>Valentina mailing list<br><a href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</a><br>http://lists.macserve.net/mailman/listinfo/valentina<br></blockquote></div><br></div></div></body></html>