Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfpoledb, free tabels, bad SELECT statement
Message
De
17/10/2003 22:53:58
 
 
À
17/10/2003 19:22:57
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00839948
Message ID:
00839970
Vues:
27
Thank you Fred for joining in,
I tried that a prior to posting this thread. Although I did not get the same error, I did get a different error. I got an OLE IDISPATCH error that advised me that I reached either EOF or BOF. But that is wrong also. Becasue the record that I am SELECTing for via the WHERE clause is a valid record. Any other thoughts?

Neil

>>Hi,
>>
>>I am having a problem when connecting to fpw26 free tables via the vfp oledb data provider. If I limit the select statement to:
>>
>>SELECT * FROM c:\gmgwin\main\arypat01.dbf"
>>
>>
>>I get a dataset that is fully populated with the table contents.
>>But if I include a WHERE clause in the SELECT statement, I get an OLE IDISPATCH error stating that I have an operator/operand mismatch.
>>
>>Please note that custid is of character type and custid = "765583" is a valid record.
>>Below is the offending code:
>>
>>
>>RELEASE oConnection
>>oConnection = CREATEOBJECT("adodb.connection")
>>
>>** set connection string for free tables ( no dbc)
>>oConnection.ConnectionString="Provider=VFPOLEDB.1;data source=c:\gmgwin\main\"
>>oConnection.Open()
>>oConnection.Errors.Clear()
>>
>>** provide full path to data table because there is no dbc
>>rs=oConnection.Execute("SELECT * FROM c:\gmgwin\main\arypat01.dbf WHERE custid=" + "765583" )
>>rs=oConnection.Execute(cString)
>>? rs.GetString()
>>
>>
>>Why do you think the SELECT with the WHERE clause is not being read properly by the data provider?
>>P.S. I have returned to my native vfp environment to perform the testing of the data provider. I am having the same problem with the data provider, connecting to free fpw26 tables, in .net but I am much more comfortable using vfp command syntax and speaking with my fellow vfp friends in this forum. They beat me up a little in the .net forum.
>>
>>Regards to all,
>>Neil
>
>If CUSTID is character, you need some quotation marks for the value, like this:
>
>
rs=oConnection.Execute("SELECT * FROM c:\gmgwin\main\arypat01.dbf WHERE custid=" + "'765583'" )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform