Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Connection String to Local Database Problem

Participant ,
Jan 12, 2010 Jan 12, 2010

I just copied a database on the development server which I am not owner of, but I have rights to the database. I copied it to my local server. Now I need to connect to the local database and I don't know how.

Dim MM_cnnName_STRING
MM_cnnName_STRING = "Provider=SQLOLEDB.1;Password=xxx;Persist Security Info=True;User ID=xxx;Initial Catalog=DBName;Data Source=DevComputerName"

The above is what I used to connect to the development server. How can I figure out the string for my local MS SQL Server

TOPICS
Server side applications
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 12, 2010 Jan 12, 2010

I thought I could change the Source attribute and the userame and password but that is not working.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2010 Jan 12, 2010

Have you created the local DSN?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 12, 2010 Jan 12, 2010

I dont know what that is exactly. I can see my database in ms sql server manager on my local machine. I thought I didn't need a dns connection so I didnt go that route. Hmm I am still trying to figure it out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2010 Jan 12, 2010

>I thought I didn't need a dns connection

You're right, you shouldn't. Is the server running on the default port?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 12, 2010 Jan 12, 2010

You might also try setting the network library to tcp/ip:

http://support.microsoft.com/kb/238949

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 13, 2010 Jan 13, 2010

What I ended up doing is opening visual studio started a project and from the object

explorer i viewed the database and got the connection string from the properties tab. Finally! ugh.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 13, 2010 Jan 13, 2010

Now I have this error once I try to bring up a page that calls the db

Microsoft OLE DB Provider for SQL Server error  '80004005'

Login failed. The login is from an untrusted domain  and cannot be used with Windows authentication.

/CourseList.asp, line  9

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2010 Jan 13, 2010

Is your connection string using the SSPI (Integrated Security=SSPI)  ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 13, 2010 Jan 13, 2010

yes. This is what it is:

Dim MM_cnnTraining_STRING
MM_cnnTraining_STRING = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=xxx;Data Source=xxx;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=xxx;Use Encryption for Data=False;Tag with column collation when possible=False"

There's also a red x over the database in the server explorer now in Visual Studio.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2010 Jan 13, 2010

Have you tried removing that entry (Integrated Security=SSPI) ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 13, 2010 Jan 13, 2010
LATEST

I get this when I try to connect when that item removed:

Microsoft OLE DB Provider for SQL Server error  '80040e4d'

Invalid authorization specification

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines