Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax problems w/ OLEDB provider?
Message
De
27/04/2004 08:58:56
 
 
À
27/04/2004 08:51:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
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:
00898472
Vues:
12
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform