|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hello,
I am trying to open a Dbase File using VB6 ADODB connection. I am getting this error message: "Path is not a valid path. Make sure that the path is spelled correctly and that you are connected to the server on which the file resides." I know and know that the 2 conditions are met. The code is as follows: ___________ Private Sub Form_Load() Dim Conn Set Conn = CreateObject("ADODB.Connection") Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\CUSTOMER.DBF;Extended Properties=DBASE IV" End Sub ___________ I know you can open dbf with ADO. and as far i can see in the documentation, the 'extented properties' paremeter is important, i tried the above and also tried one other format: ... Extended Properties=""DBASE IV;"";" and that gave the same error message. I can open the dbf file easily from a DAO control, by specifying the table name in 'recordsource' and 'dbase IV' in Connect property; but I want to do it in ADO so i can have more flexibility in controlling the record source at run time. Thank you for any input, Regards and God bless vchell |
|
#2
|
|||
|
|||
|
Did you read your error message? Is the dbf file actually in the root directory of the C drive at the path you specified?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
dbf file exists in the right place..
Yes, Doug, the file exists for sure in the same place mentioned in the code, and I am using XP home.
THanks Vchell |
|
#4
|
|||
|
|||
|
Did you post the exact error message?
Post a bit more code. Have you stepped through your code with the debugger? You should be able to pinpoint the problem in no time. |
|
#5
|
|||
|
|||
|
Hello vchell,
You just need to specify the PATH only for your Data Source. Try below, it will work. Code:
Private Sub Form_Load()
Dim Conn
Set Conn = CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=DBASE IV"
End Sub
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Opening .DBF file using ADODB connection.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|