Welcome Guest Search | Active Topics | Members | Log In | Register

Microsoft SQL Server 2000 Options · View
senthil
#1 Posted : Monday, January 22, 2007 3:54:31 AM
Rank: Member

Groups: Member

Joined: 1/3/2007
Posts: 20
Points: -40
ODBC, Open DataBase Connectivity can be utilized in two ways Standard Security and Trusted connection

Standard Security

Driver={SQL Server};Server=SERVERNAME;Database=DATABASENAME;Uid=DATABASE USERNAME;Pwd=DATABASE PASSWORD;

Trusted connection

Driver={SQL Server};Server=SERVERNAME;Database=DATABASENAME;Trusted_Connection=Yes;

Driver -> what database driver you are using to connect to the database
Server -> what database server you are ging to connect
uid -> what is the username that has previlages to access the database
pws -> is the password associated with the username

For using the Trusted connection the Windows authentication must be enabled in both hosting and database the servers.

Please add other conenctions strings that pertains to Microsoft SQL database. As far as i know i only use the 2 i specified. Also remember to describe all associated attributes that are along with the syntax.

--Thank you--
cyberviral
cyberviral
#2 Posted : Monday, January 22, 2007 4:01:15 AM
Rank: Administration



Groups: Administration

Joined: 1/4/2007
Posts: 59
Points: 167
Location: Chennai
Prompt for username and password in Microsoft SQL Server 2000

There is a property named "Prompt", so inorder to prompt you need to first set the connection object's Prompt property to adPromptAlways.
oConn.Properties("Prompt") = adPromptAlways;

after that you can use the standards security connection sting. This will not work with Trusted Connection scenarios

Driver={SQL Server};Server=SERVERNAME;Database=DATABASENAME;uid=DATABASE USERNAME;pwd=DATABASE PASSWORD;

most people aviod using this as this is not the actual practice. Its better you do it in Standard Security manner. And remember to encrypt the password before you store in web.config file or where ever you are going to store the SQL server password.


To earn money online is easy, our website finds it difficult to learn it
Catherine David
#3 Posted : Monday, January 22, 2007 4:06:26 AM
Rank: Newbie

Groups: Member

Joined: 1/4/2007
Posts: 2
Points: 6
There is also one of the most Microsoft Associated way to conenct to SQL server called OLEDB (Object Linking and Embedding Database) is used to implement Microsoft's strategy of Universal Data Access (UDA) – to access any type of data from any application (text files, spreadsheets, email, relational databases, address books) from any storage device (desktop computer, mainframe, Internet, etc.)

OLE DB, OleDbConnection (.NET) goes like Standard Security and also Trusted connection

Standard Security

Provider=SQLOLEDB;Data Source=SERVERNAME;Initial Catalog=DATABASENAME;User Id=DATABASE USERNAME;Password=DATABASE PASSWORD;


Trusted connection

Provider=SQLOLEDB;Data Source=SERVERNAME;Initial Catalog=DATABASENAME;Integrated Security=SSPI;

Perhaps its only a SQL database solution and more associated with microsoft product and technologies

Regards
senthil
#4 Posted : Monday, January 22, 2007 4:20:06 AM
Rank: Member

Groups: Member

Joined: 1/3/2007
Posts: 20
Points: -40
Hey cool even OLEDB allow Prompt property

oConn.Properties("Prompt") = adPromptAlways;

It works with OLEDB also. And this also supports to connect via an IP address, but remember that the server must have a static IP inorder to perform this. Probably it must be static.
so to connect via an IP address the syntax is like

Provider=SQLOLEDB;Data Source=192.168.40.30,1433;Network Library=DBMSSOCN;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;

the port number must be given soon after the IP address Separated by a comma [,] AND remember 1433 is the default port for SQL Server 2000, and at this instant I would like to share my experience with installation. I was downloading a movie from a torrent portal and my fate the torrent client that i was using took exclusive access to the port 1433 for downloading. So when I initiated a SQL server installation it showed me some error and I knew that the port was unavailable. I looked in to the peer connection in the torrent client to see more than 500 people connected and sharing the movie. So I also need the movie to be downloaded without interruption so I continued my SQL Server 2000 installation on some other port by doing some registry hacks and trick that I found in Google research. Days passed and finally yesterday the code dint work. Only today I spotted out the problem that I dint set up the sqlserver on the default port. So its better that you avoid this approach. Its not only with the mistake I did. When a connection is associated with the port in any IP address there is a threat associated with it.

There are many port scanning software that can get all data that are transferred from the port in that IP address. So its better that you take up the standard security approach in accessing database contents rather than explicitly giving the port in the connection string.
yug
#5 Posted : Monday, January 22, 2007 4:27:54 AM
Rank: Member

Groups: Member

Joined: 1/15/2007
Posts: 11
Points: 45
Provider=MSDASQL;Data Source=192.168.40.30,1433;Network Library=DBMSSOCN;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;

This connection must also work but it did not work for me till i found out that when we use MSDASQL we must use the connnection string

Provider=MSDASQL;Data Source=192.168.40.30,1433;Network=DBMSSOCN;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;

rather than

Provider=MSDASQL;Data Source=192.168.40.30,1433;Network Library=DBMSSOCN;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;

The difference is just the given a different formatting in red color. I found it from the most comprehensive website for connection string the www.connectionstrings.com, i have never seen a much comprehensive website like this. Please visit the website. Its cool...
cyberviral
#6 Posted : Monday, January 22, 2007 4:59:13 AM
Rank: Administration



Groups: Administration

Joined: 1/4/2007
Posts: 59
Points: 167
Location: Chennai
There is also a System.Data.SQLClient namespace that is exclusively dedicated towards creating Microsoft SQL server database connections. The SqlConnection (.NET) are of 4 types this it self is the proof for customization option that is enabled by Microsoft. They are Standard Security, Trusted Connection and IP address that are the normal methods. But there is another method that is specifying the packet size. Let describe everything in a isolated manner

Standard Security

Data Source=SERVERNAME;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;

Please note that in the connection string for SqlConnection (.NET) instead of the Data Source= SERVERNAME we can also use simply Server=SERVERNAME, both produce the same results.

Trusted Connection

Data Source=SERVERNAME;Initial Catalog=DATABASENAME;Integrated Security=SSPI;

Where SSPI stands for Security Support Provider Interface, Provides a standard application interface to a number of security models.


Connect via an IP address

Data Source=1 92.168.40.30,1433;Network Library=DBMSSOCN;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;

AND FINALLY the Specifying packet size which is really the new concept in sqlconnection for .NET

Server=SERVERNAME;Database=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;Trusted_Connection=False;Packet Size=3999;

And remember any queries related to the database connection string please logon to http://www.connectionstrings.com as i too have found the website most comprehensive for connections string references. And moreover the website has more fans also.
To earn money online is easy, our website finds it difficult to learn it
ravi
#7 Posted : Monday, January 22, 2007 5:08:27 AM
Rank: Member

Groups: Member

Joined: 1/15/2007
Posts: 22
Points: 66
Data Shape is also another Microsoft Innovation that can also come in handy in special cases, so here are the syntax

MS Data Shape

Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=SERVERNAME;Initial Catalog=DATABASENAME;User ID=DATABASE USERNAME;Password=DATABASE PASSWORD;
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.731 seconds.