PDA

View Full Version : Lianja and OleDB



HankFay
2013-09-16, 15:58
In theory, OleDB is just another activex class. (As to why I would care: let's just say it's an important edge condition.)

Anyway, the following code runs from within VFP (after having moved the northwind directory from vfp samples to c:\temp, so I didn't have to mess with progra~1 etc): The driver itself is downloaded from here: http://www.microsoft.com/en-us/download/details.aspx?id=14839

oConn = createobject("ADODB.Connection")oRS = createobject("ADODB.Recordset")
lcConnString = "Provider=vfpoledb;Data Source=C:\Temp\Northwind\northwind.dbc"
oconn.ConnectionString = lcConnString
oconn.Open()
oRS.Open("select * from customers",oconn)
? oRS.Fields("companyname").Value
oRS.Movenext()
? ors.Fields("companyname").Value

This works in VFPl In Lianja, oRS.Fields(....) produces an error: METHOD 'FIELDS' not found.

Is this an infelicity in ActiveX compatibility, or is it something special about the "ADODB.Recordset" class?

thanks,

Hank

barrymavin
2013-09-17, 00:54
You can SET DEBUG ON and you will see helpful information about what the ActiveX is exposing and how Lianja is interacting with it.

HankFay
2013-09-17, 07:33
You can SET DEBUG ON and you will see helpful information about what the ActiveX is exposing and how Lianja is interacting with it.

Wow: that's cool! That (debug_client.txt) has almost all the informaton needed for intellisense (except the names of the parameters).

Anyway, here's the entry for Fields of the Recordset class:


File ../../rco_activex.cpp at line 225 PROPERTY name=Fields type=IDispatch*

Looks like a pointer to IDispatch, if I'm reading it right.

thanks,

Hank

barrymavin
2013-09-17, 09:05
Yes its returning it a property not a method. Thats the issue right there. Ticket it i'll see if i can proxy it as method.

barrymavin
2014-12-24, 11:03
This is an old post but this should all be working as expected in v1.3.