Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fox 7 Says 'This OCX can only be hosted by Visual Foxpro
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00755824
Message ID:
00757472
Views:
12
>>Since VFPCOM is still a viable download and since it seems to work ok in Development I'm assuming that I shouldn't have any problems.
>
>You need to grab the updated VFPCOM from here.

I have to make some corrections to previous posting. Updated VFPCOM works with Date and Double data types, but doesn't work with wide strings. You can easily test it. This code returns an empty "gen" for all fields, except Integer and Currency:
Local oComUtil, oRS, oCn, i, oTable, lcCursor
Local lcMDBPath, lcMDBStr, oCat

lcMDBPath = "C:\Program Files\Microsoft Visual Studio\VB98\NWind.mdb"
lcMDBStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" + lcMDBPath + ";"

Clear
?
oComUtil = Create("vfpcom.comutil")
oCat = Create("adox.Catalog")
oCn = Create("adodb.Connection")
oRS = Create("adodb.Recordset")
oRS.CursorLocation = 3	&& adUseClient
oRS.LockType = 3		&& adOpenStatic
oCn.Open(lcMDBStr)
oCat.ActiveConnection = oCn

i = 0
For Each oTable In oCat.Tables
	If oTable.Type = "TABLE" Then
		lcSrc = "[" + oTable.Name + "]"

		oRS.Open(lcSrc, oCn)
		oComUtil.RSToCursor(oRS)
		? oTable.Name
		lcCursor = Alias()
		?? " Rows:", RecCount((lcCursor)), "Fields:", FCount((lcCursor))

		oRS.Close()
		BROWSE NOWAIT NAME oBrowse
		oBrowse.Left = 20 * i
		oBrowse.Top = 20 * i
		i = i + 1
	Endif
Next
oCn.Close
Previous
Reply
Map
View

Click here to load this message in the networking platform