Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP - problem with DATE field
Message
From
12/12/2006 13:30:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/12/2006 08:00:50
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01176801
Message ID:
01176934
Views:
8
>Hi everyone!
>
>I am having the issue with date field while accessing VFP table from ASP (thru VBScript). The following statement
>
>SELECT * FROM tblAbc WHERE trans_date = > ‘11/21/2006’ AND trans_date < = ‘11/27/2006’
>
>returning an error
>
>“ODBC driver does not support the requested properties”
>
>Connection to the table:
>------------------------------------
>set cn = Server.CreateObject("ADODB.Connection")
>cDatabasePath = Server.MapPath("/DATA")
>connstr = "Driver={Microsoft Visual FoxPro Driver}; UID=;SourceDB="&cDatabasePath&";SourceType=DBF;"
>cn.Open connstr
>
>adOpenStatic = 3
>Set rs = CreateObject("ADODB.Recordset")
>------------------------------------
>
>I would appreciate any input

You better use parameters:
strSelect = "SELECT * FROM tblAbc WHERE trans_date between ? AND ?"
set cmd = CREATEOBJECT("ADODB.Command")
cmd.CommandType = 1
set pStart = cmd.CreateParameter("start",adDate)
set pEnd = cmd.CreateParameter("end",adDate)
pStart.Value = #...#
pEnd.Value = #...#
cmd.Parameters.Append( pStart )
cmd.Parameters.Append( pEnd )
cmd.ActiveConnection = con
set oRS = cmd.Execute()
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
Reply
Map
View

Click here to load this message in the networking platform