SQL Server Configuration connection data source

Source: Internet
Author: User
Tags dsn management studio sql server management sql server management studio

When developing a student information management system, the most important thing is to connect to the database.

After you have completed the vbprogram, you must first install the database. After the installation is complete, there will be several applications. Based on SQL
Server versions are different. In SQL 2000, the Enterprise Manager event probe queries analyzer and so on.
The 2008 types are SQL Server Management studio.


Database login. When you open sqlserver management studio, there are two login methods:

Your database, or the so-called server, is used for Windows authentication.

In this case, only local users in the local user and domain user can use it. Therefore, it is generally not used.

When logging on to the database for the first time, enter the database as a Windows Authentication identity, and then set the database login name, called the database role.


Is also called a super administrator. You can also create your own database account. Set your login Login name and password.

Configure the login attributes and server roles of the account you set.

Ensure that you have the SysAdmin privilege. Otherwise, you cannot create a database as your identity.


Allow external database connection.


Then, open the SQL file and execute the generated database.

Now that the database has been generated, configure the data source. Open Control Panel-Administrative Tools-ODBC Data Source Management Program.



Enter the name of the data source, which corresponds to the connection in the VB program.


In this location, the connected database can also be directly written
IP address. In this way, you can connect to a database server that is not your computer. Of course, the other party must agree to enter.



 

Filedsn = data source file name. Uid = database login name. Pwd = database login password.

Note: The database login name is not the user name in the student information management system.

 

Code for connecting to the data source in VB. There are three connection methods.

ConnectString ="FileDSN=student.dsn;UID=sa;PWD=123"ConnectString = "provider=sqloledb;server=192.168.24.225;UID=sa;PWD=123;database=student"ConnectString ="FileDSN=student.dsn;UID=sa;PWD=123;server=192.168.24.225;persist securityinfo=false"

In short, no matter which connection is used. Your connection statement in the database must specify your data source file. And your database login name and password. Otherwise, the database cannot be connected.

Of course, if you are using Windows authentication, you only need to specify the data source file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.