spiral
asked on
ado dbf connection string doesnt accept spaces?
i m using this connection string but
when the user select sourcedb = some path where
there are spaces in between the directory eg
"c:\thework\i know\test.dbf" i will get an error!
how to resolve this error?
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDb=\somepath\mySour ceDb.dbf;" & _
"Exclusive=No;"
when the user select sourcedb = some path where
there are spaces in between the directory eg
"c:\thework\i know\test.dbf" i will get an error!
how to resolve this error?
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDb=\somepath\mySour
"Exclusive=No;"
ASKER
yes i have tried but not working
is it possible that you cannot specify the dbf file into the connection string (you will name it into the query)?
see http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForVisualFoxPro
see http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForVisualFoxPro
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what does GetShortPathName do?
It returns the 8.3 path name that represents the path you are using for example:
c:\Program Files\Microsoft Visual Studio\VB98
becomes
c:\Progra~1\Micros~1\VB98
Which never includes spaces and should be understandable in win9x,NT,2000,XP
c:\Program Files\Microsoft Visual Studio\VB98
becomes
c:\Progra~1\Micros~1\VB98
Which never includes spaces and should be understandable in win9x,NT,2000,XP
ASKER
ok thanks i will try it out tomorrow
ASKER
TimCottee: it works thank u. but when i try to rename my folder which has spaces to other filename directory, it doesnt allow me. how to release the kernel32.dll which was
accessing it previously?
accessing it previously?
spiral, can you explain that? You don't need to rename your folder to the 8.3 version as these are equivalent and refer to the SAME folder just in different ways. Wherever you use the fullpath you can use the shortpath in the same place.
ASKER
i meant when i run my program under the vb6 development environment, everything is ok but when i unload my program
go to windows explorer and rename the folder which i previously accessed, i cant rename it. I need to shut down vb6 and then i can rename the file folder. why is this so?
it says the file folder is still in use. but i already unload my program! is the kernel32 causing this problem?
go to windows explorer and rename the folder which i previously accessed, i cant rename it. I need to shut down vb6 and then i can rename the file folder. why is this so?
it says the file folder is still in use. but i already unload my program! is the kernel32 causing this problem?
Kernel32 has nothing to do with this. My guess is that you have not properly terminated the ADO objects that you have instantiated. Ensure that you do oConn.Close and oRst.Close and then Set oConn = Nothing and Set oRst = Nothing when you have finished using the objects.
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDb=""\somepath\mySo
"Exclusive=No;"