I have a third party application that has a SQL database I am trying
to work with this in my code but the database name has a space in it
so when I try the following connection string:
Dim connString As String = "server=10.0.0.1;uid=sa;pwd=;Initial
Catalog=Third Party"
I assume it is cutting the name off at "Third". I have no control
over the databases name otherwise I would just have named it correctly
with no spaces. I have tried using single quotes surrounding the name
but that did not seem to help. Any suggestions?
Lebrun Thomas - 30 Jul 2004 17:58 GMT
Maybe you can try
Dim connString As String = "server=10.0.0.1;uid=sa;pwd=;Initial
Catalog='Third Party'"
Bye.
--
LEBRUN Thomas
http://morpheus.developpez.com
> I have a third party application that has a SQL database I am trying
> to work with this in my code but the database name has a space in it
[quoted text clipped - 7 lines]
> with no spaces. I have tried using single quotes surrounding the name
> but that did not seem to help. Any suggestions?
mikeb - 30 Jul 2004 18:41 GMT
> I have a third party application that has a SQL database I am trying
> to work with this in my code but the database name has a space in it
[quoted text clipped - 7 lines]
> with no spaces. I have tried using single quotes surrounding the name
> but that did not seem to help. Any suggestions?
Are you using the SqlConnection object, or some other data provider?
I have no problems with an Initial Catalog that contains spaces in the
name. That includes with or without putting the database name in single
quotes (it works either way).
If you're using VS.NET, use the Server Explorer to connect to the
database - you can use the connection string it generates (after
removing a few items that the ADO.NET SQL server provider does not
support).
If Server Explorer can't connect to the database, then you can
troubleshoot from there.
I'm using .NET Framework 1.1 and SQL Server 2000.

Signature
mikeb
Glenn Wilson - 03 Aug 2004 11:20 GMT
Try Putting [Around the name]
> I have a third party application that has a SQL database I am trying
> to work with this in my code but the database name has a space in it
[quoted text clipped - 7 lines]
> with no spaces. I have tried using single quotes surrounding the name
> but that did not seem to help. Any suggestions?
Scott D - 26 Aug 2004 03:15 GMT
Thanks all the [] worked fine.