Friday, March 23, 2012

Problems connecting to SQL server(data source)

Hi,

I am new to SQL server and am experiencing problems with connecting to SQL server express from my VS C++ 6. Since its just the start, I am trying to play around with data access on the computer with the server installed.

I want to connect to the server through ODBC and understand that I can do so by first creating a data source. However, at the Data Source Administrator, there were errors when connecting to the server. I tried with different server names, with Shared memory/TCP/Named pipes enabled(in all combinations) at the Configuration Manager but to no avail.

However, I am able to contact to the server through Shared memory at the Management Studio Express. I don't know what is wrong.

Let me know if you need extra information to give me assistance.

Thanks in advance.

Mel

The most likely issue is that you haven't applied the SQLEXPRESS instance name to your server on the first page.

Name: <any name>

Description: <any description>

You could use either of the following for your server name:

Server: <server name>\SQLEXPRESS

Server: .\SQLEXPRESS

Server: (local)\SQLEXPRESS

I think you can bypass creating a data source in ODBC by specifying the information directly in the connection string,

a simple connection string might look like "DRIVER={SQL Native Client}; SERVER=(local)\SQLEXPRESS; Trusted_Connection=YES". This link might offer a little bit of help: http://doc.ddart.net/mssql/sql70/6_odbcht_6.htm You should also check out the SQL Server 2005 samples, they have a fairly decent ODBC section. You can download them here: http://www.microsoft.com/downloads/details.aspx?familyid=e719ecf7-9f46-4312-af89-6ad8702e4e6e&displaylang=en

Hope this helps!

John

sql

No comments:

Post a Comment