Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fox 7 Says 'This OCX can only be hosted by Visual Foxpro
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00755824
Message ID:
00757472
Vues:
19
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform