< návrat zpět

MS Excel


Téma: ADO DBF/FoxPro rss

Zaslal/a 11.8.2022 17:50

Dobrý den,
nemáte prosím někdo connectionstring pro připojení ke složce se soubory dBase pro ADODB.Connection?

Původní varianta :

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;Password=;

Lze použít varianta níže? Nedaří se mi zprovoznit.

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;

Za případnou pomoc předem děkuji.

Zaslat odpověď >

#053147
Stalker
https://www.connectionstrings.com/citovat
#053152
avatar
Děkuji moc za reakci, tam jsem byl. 5
Jinde taky píšou, že Provide Microsoft.ACE.OLEDB zvládne načíst tabulky dBase, u mě bohužel bez úspěchu. 7citovat
#053153
avatar
cn_str = "Provider=Microsoft.ACE.OLEDB.16.0;" & _
"Data Source=" & db_folder & ";" & _
"Extended Properties=dBASE IV" '& ";" & _
'"User ID=Admin"


Omlouvám se, ale záleží, co je na kterém pc k dispozici. 5

Není možné vypsat list naistalovaných providers pomocí VBA?
Nejspíš vytahat z registru?

Pomocí vb.NET stačí :
Dim oledb_enu As OleDb.OleDbEnumerator = New OleDb.OleDbEnumerator
Dim dt As DataTable = oledb_enu.GetElements


Jak zavolat verzi provideru podle verze Excelu?
Neřešil někdo?citovat
#053154
avatar
VBScript to list installed OLEDB Providers :
https://sysmod.wordpress.com/2014/07/11/vbscript-to-list-installed-oledb-providers/

Pozor běží dost dlouho, než prochroupe registry!

Pro VBA upravit asi takhle :
'List of installed OLEDB providers on local computer
Option Explicit
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005

Sub InstaledProviders()

Dim OutText, strComputer, objRegistry
Dim Num
Dim ProgIdDict

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
OutText = "Note: Strike Ctrl+C to copy full text to clipboard"
Num = 1
Set ProgIdDict = CreateObject("Scripting.Dictionary")

' I discovered these registrations can appear in three different places.
' Use ProgIdDict to prevent dupes in the output
Append objRegistry, HKEY_CLASSES_ROOT, "HKEY_CLASSES_ROOT", "CLSID", ProgIdDict, Num, OutText
Append objRegistry, HKEY_LOCAL_MACHINE, "HKEY_LOCAL_MACHINE", "SOFTWARE\Classes\CLSID", ProgIdDict, Num, OutText
Append objRegistry, HKEY_LOCAL_MACHINE, "HKEY_LOCAL_MACHINE", "SOFTWARE\Classes\Wow6432Node\CLSID", ProgIdDict, Num, OutText

Debug.Print OutText

End Sub

Sub Append(ByVal objRegistry, ByVal HKEYConstant, ByVal HKEYConstantStr, ByVal KeyPrefixStr, ByVal ProgIdDict, ByRef Num, ByRef OutText)

Dim Key, arrKeys
Dim strKeyPath, strValue, uValue

objRegistry.enumKey HKEYConstant, KeyPrefixStr, arrKeys

For Each Key In arrKeys

strKeyPath = KeyPrefixStr & "\" & Key

' if key exists...
' I noticed something weird where non-MSOLAP entries use the first style,
' and MSOLAP entries use the second style.
If 0 = objRegistry.GetDWordValue(HKEYConstant, strKeyPath, "OLEDB_SERVICES", uValue) _
Or 0 = objRegistry.GetDWordValue(HKEYConstant, strKeyPath & "\OLEDB_SERVICES", "", uValue) _
Then
objRegistry.GetStringValue HKEYConstant, strKeyPath & "\ProgID", "", strValue
If Not ProgIdDict.Exists(strValue) _
Then
ProgIdDict.Add strValue, strValue
OutText = OutText & vbCrLf & vbCrLf
'get the (Default) value which is the name of the provider
objRegistry.GetStringValue HKEYConstant, strKeyPath, "", strValue
OutText = OutText & Num & ") " & strValue & vbCrLf & "Key: \\" & HKEYConstantStr & "\" & KeyPrefixStr & "\" & Key
' and the expanded description
objRegistry.GetStringValue HKEYConstant, strKeyPath & "\OLE DB Provider", "", strValue
OutText = OutText & vbCrLf & "OLE DB Provider: " & strValue
objRegistry.GetStringValue HKEYConstant, strKeyPath & "\ProgID", "", strValue
OutText = OutText & vbCrLf & "ProgID: " & strValue
objRegistry.GetStringValue HKEYConstant, strKeyPath & "\VersionIndependentProgID", "", strValue
OutText = OutText & vbCrLf & "VersionIndependentProgID: " & strValue
Num = 1 + Num
End If
End If
Next

End Sub
citovat

Uživatelské menu

Nejste přihlášen(a)
avatar\n

Menu

On-line nástroje

Formulář Faktura

Formulář Faktura IV

Oblíbený formulář Faktura byl vylepšen a rozšířen.
Více se dočtete zde.

Aktivní diskuse

Relativní cesta - zdroje Power Query

elninoslov • 23.4. 19:33

Vyhledej

elninoslov • 23.4. 18:54

Vyhledej

PavDD • 23.4. 12:29

Vyhledej

PavDD • 23.4. 11:47

Relativní cesta - zdroje Power Query

Alfan • 23.4. 10:52

Relativní cesta - zdroje Power Query

elninoslov • 23.4. 10:22

Relativní cesta - zdroje Power Query

lubo • 23.4. 10:15