Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Dates to Fox 2.6 Tables using oledb
Message
From
11/05/2005 18:10:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/05/2005 15:32:34
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01013123
Message ID:
01013184
Views:
12
>I am having a problem querying fox 2.6 data from .Net with regards to date
>
>I have a date field in the 2.6 table but cannot seem to figure out how to pass the date in the sql string in a way that wil just return dates that match today's date. I can get all data just fine but with the date condition I return no data. Below is an snippet of the code
>
>
>   Try
>            Dim lcsql As String = "select * from crdlog where entdate = 05/11/2005" '& Date.Today
>            MsgBox(lcsql)
>            Dim ocon As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\actionxp\data;Extended Properties=dBASE IV;User ID=Admin;Password=")
>            Dim oda As New OleDb.OleDbDataAdapter(lcsql, ocon)    '
>            oda.Fill(ds)
>
>            MsgBox(ds.Tables(0).Rows.Count) 'should be 6 records
>        Catch EX As Exception
>            Console.WriteLine(EX.Message)
>        End Try
>
>
"select * from crdlog where entdate = date()"

If you use VFPOLEDB driver instead (you should):
"select * from crdlog where entdate = date()"
or:
"select * from crdlog where entdate = {^2005/5/11}"
would work (I don't kmow if latter would work with Jet driver).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform