Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax problems w/ OLEDB provider?
Message
De
27/04/2004 08:51:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
27/04/2004 08:47:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00898465
Message ID:
00898466
Vues:
11
>Can someone help me with a problem I am having with an adodb sql statement?
>The following lines work fine in the vfp command window:
>
>
>xStartTime = CTOT("04/25/04 07:00:00")
>xEndTime = CTOT("04/25/04 17:00:00")
>SELECT * from meetings WHERE BETWEEN(starttime,xStartTime,xEndTime)
>
>
>the SELECT statement returns all of the records whose StartTimes are between xStartTime and xEndTime.
>
>But when I attempt to use the statement in the context of adodb I hit the wall.
>For example:
>
>
>oConnection = CREATEOBJECT("adodb.connection")
>oConnection.ConnectionString="Provider=VFPOLEDB.1;data source=C:\Inetpub\wwwroot\2004_gmg\data\Appointments.dbc"
>Connection.Open()
>oConnection.Errors.Clear()
>
>
>No matter how I build mySQL I seem to get it wrong:
>
>mySQL =  "SELECT * from meetings WHERE BETWEEN" + "(" + "StartTime" +;
 ", "  +  TRANSFORM(xStartTime) + ", " + TRANSFORM(xEndTime) + ")"
>rs=oConnection.Execute(mySQL)
>? rs.GetString()										
>RELEASE oConnection
>
>
>This generates an error stating that a function is missing a “)”. But nothing I attempt works.
>
>Please assist me in the proper syntax of mySQL to pass into oConnection.Execute.
>Thank you
>Neil
xStartTime = "^2004/04/25 07:00"
xEndTime   = "^2004/04/25 17:00"
mySQL =  "SELECT * from meetings WHERE StartTime BETWEEN "+;
 "ctot(xStartTime) and ctot(xEndTime)"
rs=oConnection.Execute(mySQL)
? rs.GetString()										
RELEASE oConnection
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform