HankFay
2013-09-16, 14: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
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