Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to DB with space in name?

Status
Not open for further replies.

karenpc

Programmer
Mar 22, 2001
9
US
I have an access database named Inservices Data.mdb Is there any way to specify this so my connect will work? VB does not like this...
data1.databasename = c:\Inservices\Inservices Data.mdb

thanks!
 
Have you tried enclosing it in quotes?

data1.databasename = "c:\Inservices\Inservices Data.mdb"

 
Yes I have tried this with quotes, but it doesn't work.
 
you could just change the name of the db so there isn't a space
----------------
Joe
 
That thought had crossed my mind. But since numerous people are using it on a server, I don't think they would appreciate that.
 
If you are using this on a server the problem might be that you are referencing the C: drive for this database.
 
Make an ADO object, and use the connection string wizard to bind to it. Then cut out the path part of it, delete the ADO object, and paste that path in your code. Give it a try anyways.
 
I have some DB's with a space. I just put brackets around the name and it works OK. I use SQL though. Try it like this:


c:\Inservices\[Inservices Data.mdb]


Rob
Just my $.02.
 
Thanks very much Rob. The brackets worked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top