Database - Setup MS SQL Server
This article outlines how to have EZSurvey (Pro version only) interact with Microsoft SQL Server and submit user data to Microsoft SQL Server with immediate data collection. It is best to create a new Login in SQL Server. The two sections of this article are SQL Server and EZS CGI on the same server. and SQL Server and EZS CGI on the different servers.
SQL Server and EZS CGI on the same server:
This is an example of how to set SQL Server and EZSurvey.
- Open SQL Server Enterprise Manager and select Database. Right click Database and select New Database. Enter the new database name. In this case we are calling it ezstables. You should see that a new database has been created.
- Creat a Login account for SQL Server. Select Login under Security. Right click Login and select New Login.
- On the Login Properties window on the General tab, select the ... button next to the Name box.
- A list of names will appear. Select the Internet Guest Account. It will be named something like IUSR_COMPUTERNAME, where COMPUTERNAME is the name of your computer. In this case the computer name is COMPUTERNAME. When you have done this, press Add and then OK.
- You will be taken back to the Login Properties window. Select Windows Authentication and select the Default Database.
- Select the Database Access tab and allow permissions on the database called ezstables Press OK
- You will now see a new Name in the list of Logins. In this case it is COMPUTERNAME\IUSR_COMPUTERNAME
- Expand the database you are working with. Select Users. If the internet guest account user is not listed right click and select Users and select New Database User.
- Right click on the ezstables database and select Properties. Then select Permissions. Allow the new account to be able to Create Table. Press OK.
- After EZSurvey Pro creates a table in the SQL Server database, select the table. Right click it and select Properties.
- In the Object Properties window allow the user to INSERT. Press OK.
Create a Data Source Name Entry.
- Go to the ODBC Data Source Administrator. It is normally found in the Administration Tools. Go to the System DSN tab and select Add.
- The Create New Data Source window will open. Select SQL Server. Press Finish.
- Type in the name that you want to give the Data Source. In this case it is called ezstables. Select (local) for the Server. Press Next.
- Select With Windows NT authentication using the network login ID. Press Next.
- For Change the default database to:, select the database that was created in SQL Server. In this case it is ezstables. Press Next.
- The next page will look like this. Press Finish.
- When you run a Data Source Test, it will show you the TESTS COMPLETED SUCCESSFULLY! message.
- When you are done, you should see the new System Data Source entry listed.
Connect EZSurevy Pro Desktop top the ODBC Data Source.
- After you have created the Data Source, go into EZSurvey Pro and select File Properties Database. In the Database Properties window, remove the Database file name. For the Database type, select ODBC. Press Save. The Open Database window will show. Select Browse.
- The Select Data Source window will open. Go to the Machine Data Source tab and select the Data Source that you created. Press OK
- In the Table name box, type a new name for the table. Then Open.
Connect EZSurvey Pro CGI to the ODBC Data Source.
- Go to the Web form setup window by selecting Publish Create a web form and configure a site to publish the form on. Select Save to a database with ODBC. Press Setup.
- Type in the name of the Data Source, in this case it is EZSTables. Type in the name of the table. Press Save. Then press OK on the Web form setup window to publish the form.
SQL Server and EZS CGI on different servers:
To connect 3rd party CGI's to SQL Server for the purpose of inserting records, follow these instructions.
On the SQL Server:
- Open SQL Server Enterprise Manager.
- Select Tools SQL Server Configuration Properties Security.
- For Authentication, select SQL Server and Windows. Select OK.
- Select the server node then Security Logins.
- Create a new login with SQL Server Authentication and set the password.
- Select Database Access and Permit the database to be used by the new login.
- Select OK.
- After the table is created, permissions need to be set for the login to access the table.
- Select the Permissions on your table.
- Enable insert permission for your user.
On the Web Server:
- Create a new System DSN entry with the SQL Server Driver.
- Connect the DSN to the SQL Server computer where it says Server:.
- Select With SQL Server authentication using a login ID and password entered by the user.
- Select Connect to SQL Server to obtain settings for the additional configuration options.
- Enter the Login ID and Password from the user that was created on the SQL Server computer.
- Select Change the default database to: and select your database.