I am connecting to a SQL Express database from Excel 2K.
I have three connection strings examples. The first two work however the
third was the one I wanted to use as I do not want to specify a local db.
These two work fine:
strConn = "PROVIDER=SQLOLEDB; DATA SOURCE=(local);INITIAL CATALOG=IPS;
Trusted_Connection=yes;"
strConn = "PROVIDER=SQLOLEDB; DATA SOURCE=(local);INITIAL CATALOG=IPS;
INTEGRATED SECURITY=sspi;"
This one doesn't which I got from http://www.connectionstrings.com/ I like
it as it is simple and easily understood.
strConn = " Server=dimension9150;Database=IPS;Truste
d_Connection=yes;"
The server name is dimension9150 as is verified in the following:
C:\>sqlcmd -S dimension9150
1> SELECT name FROM sys.databases
2> GO
name
----
--
---
master
tempdb
model
msdb
IPS
(5 rows affected)
1> exit
C:\>
Thanks in advance...Hi,
Yuu can use all of the above mentioned, the (local) can be exchanged by
the servername you want to work on like:
strConn = "PROVIDER=SQLOLEDB; DATA SOURCE=Dimension9150;INITIAL
CATALOG=IPS;
INTEGRATED SECURITY=sspi;"
(local) is only a pointer like "." or localhost to your current machine
you are connecting from. if you want to use another instance than the
default one, you have to additionally specify the instancename within
the servername, something like this: servername\instancename if you are
using a different port number than the original one,you can use
servername\instancename,Portnumber.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment