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

P

Przemek

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.
 
J

Jacob Skaria

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
 
P

Przemek

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 ?
 
J

Jacob Skaria

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 said:
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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top