Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfpoledb, free tabels, bad SELECT statement
Message
From
20/10/2003 14:39:08
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00839948
Message ID:
00840403
Views:
11
Yes... But I had to reindex the data table before any select other than "select *" would work. Thanx to Cetin I found that I had 2 index tags on custid. FPW26 was ok with it but vfpoledb choked.

Thanx again,
Neil

>Does the SELECT I showed you work if you try it directly from inside VFP at the Command Window?
>
>
>>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'" )
Previous
Reply
Map
View

Click here to load this message in the networking platform