Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default [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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default [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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default [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"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default [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"




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default [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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB Connection fi.or.jp.de Excel Worksheet Functions 0 September 9th 09 09:23 PM
Set cnn = New ADODB.Connection burl_h Excel Programming 4 February 17th 09 06:55 PM
ADODB.Connection Bogdan Excel Programming 7 July 16th 07 03:42 PM
ADODB.Connection Jez[_7_] Excel Programming 0 October 13th 06 12:02 PM
ADODB Connection Problem alpder Excel Programming 3 November 4th 05 09:28 PM


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"