ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   [Excel2007] How to obtain provider name for ADODB.Connection (https://www.excelbanter.com/excel-programming/428286-%5Bexcel2007%5D-how-obtain-provider-name-adodb-connection.html)

Przemek[_2_]

[Excel2007] How to obtain provider name for ADODB.Connection
 
Hi!.

I'm trying to connect to .dbf files via adodb service.
The problem is that i dont know how to obtain correct provider name for the
chosen ODBC driver.

On msdn website i've found that its enough to choose standard
Microsoft.Jet.OLEDB.4.0,
but it doesn work with VFP .dbf files (unrecognized database file format ).

I have several odbc drivers innstalled and i could work with any of them,
but i cant find the way
to know its provider name.



Jacob Skaria

[Excel2007] How to obtain provider name for ADODB.Connection
 
Please note that when you work with .dbf files the source DB will the folder
and not the database file.. Try and feedback

Dim con As New ADODB.Connection

con.Open "Driver={Microsoft FoxPro VFP Driver (*.dbf)};
SourceType=DBF;SourceDB=c:\;NULL=No;Exclusive=No"

If this post helps click Yes
---------------
Jacob Skaria


"Przemek" wrote:

Hi!.

I'm trying to connect to .dbf files via adodb service.
The problem is that i dont know how to obtain correct provider name for the
chosen ODBC driver.

On msdn website i've found that its enough to choose standard
Microsoft.Jet.OLEDB.4.0,
but it doesn work with VFP .dbf files (unrecognized database file format ).

I have several odbc drivers innstalled and i could work with any of them,
but i cant find the way
to know its provider name.




Przemek[_2_]

[Excel2007] How to obtain provider name for ADODB.Connection
 
Private Sub proba()
Dim aCon As ADODB.Connection

Set aCon = New ADODB.Connection
aCon.Open "Driver={Microsoft FoxPro VFP Driver (*.dbf)}; " & _
"SourceType=DBF;SourceDB=c:\temp\database\;NULL=No ;Exclusive=No"

End Sub

generates Run-time error
"[Microsoft][ODBC Driver Manager] The driver doesnt support this function"
Its just error translation from polish.

But ...
MS VFP Driver isn't added as a system nor user DSN. It just exists as a
driver in ODBC Sources in System Manager.
I'm not sure if i have to add it to DSN.

BTW.
i read that declaration such "dim variable as new Object" is not
recommended.
Is it true or its' no matter ?


Dim con As New ADODB.Connection

con.Open "Driver={Microsoft FoxPro VFP Driver (*.dbf)};
SourceType=DBF;SourceDB=c:\;NULL=No;Exclusive=No"




Jacob Skaria

[Excel2007] How to obtain provider name for ADODB.Connection
 
Please check the driver you have. i am using Microsoft® Visual Foxpro® ODBC
Driver version 6.1.8630.1 . (vfpodbc.dll)

Hope you have referred Microsoft ActiveX Data Objects 2.x Library

If this post helps click Yes
---------------
Jacob Skaria


"Przemek" wrote:

Private Sub proba()
Dim aCon As ADODB.Connection

Set aCon = New ADODB.Connection
aCon.Open "Driver={Microsoft FoxPro VFP Driver (*.dbf)}; " & _
"SourceType=DBF;SourceDB=c:\temp\database\;NULL=No ;Exclusive=No"

End Sub

generates Run-time error
"[Microsoft][ODBC Driver Manager] The driver doesnt support this function"
Its just error translation from polish.

But ...
MS VFP Driver isn't added as a system nor user DSN. It just exists as a
driver in ODBC Sources in System Manager.
I'm not sure if i have to add it to DSN.

BTW.
i read that declaration such "dim variable as new Object" is not
recommended.
Is it true or its' no matter ?


Dim con As New ADODB.Connection

con.Open "Driver={Microsoft FoxPro VFP Driver (*.dbf)};
SourceType=DBF;SourceDB=c:\;NULL=No;Exclusive=No"





Przemek[_2_]

[Excel2007] How to obtain provider name for ADODB.Connection
 
and all is clear...
driver ver. 1.00.02

MSADO ver. 2.8

thank You

Please check the driver you have. i am using MicrosoftR Visual FoxproR
ODBC
Driver version 6.1.8630.1 . (vfpodbc.dll)

Hope you have referred Microsoft ActiveX Data Objects 2.x Library





All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com