Windows server2008 Build ASP Interface access to Oracle database complete process record

Source: Internet
Author: User
Tags dsn odbc

Really is too easy, once in Window Server 2003 built a set of Asp+oracle interface System. It cost a great effort, in fact that will be fascinated gaze stare also don't know how to fix, also lazy tube. OK, from yesterday to today to deploy the interface from the test environment to the public network environment, there are a variety of problems. It must be recorded this time.

Let's take a look at the overall scenario for this interface system:

The use of ASP is due to the lightweight interface system, only need to change the copy and paste the interface immediately after the effective. Instead of having to use Tomcat to package, upload, and deploy this interface program like the Java system. The system is now enabled on Windows Server, and then the Web page service is established. Then connect to the database via ODBC, and access and connect to the Oracle database on the Web page.

Here's how to implement this process in one step at a start.

1. Startup of the IIS service.

References Link: Http://www.ip-tcp.com/?tag=windows-server-2008-iis-%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E8%A3%85%E4%B8%8E %e9%85%8d%e7%bd%ae

Since we are deploying ASP, remember to put these two related hooks on. It doesn't matter if I don't check the net, but it's safe to check it out, not much.


After the installation is complete, IIS Manager can be found in the administration tool.


Here I am in fact because IIS has been started, but it is not expected to be started correctly, I looked for a long time did not find IIS Manager, later rage again the IIS service shut down and then start again, Hook on ASP, OK. Very many times. Suppose you think you have a problem with your operation. Or someone else has already done for you, but do not know why there is a problem, delete it again to get it.

We then right-click on the site. Select Join Site



Pop out the following interface:



This is the name of the site to write just fine. Physical path Choose a directory of your own creation. Do not change the type and IP address. Keep HTTP and All Unassigned , Port can fill in one. Because we already have a site on the server 80port, so I actually used 8080; hostname can not write, then click OK

Note here that the IIS default page will take up 80port, and colleagues have just come to me to say that their pages are open to IIS7 pages. I saw that the port was occupied.

Here our site has in fact been established. Be able to write a simple test page in the folder below your own site, this is the site folder I just finished. A simple index.html page


.

You can see 123456 on the page by typing 127.0.0.1:8080 inside the browser. It means that our page has been built. Suppose your server is able to access the public network. Enter your public IP address directly plus the port number, and you will be able to see the newly created page.

In fact, the site has been built up here. But there are two additional steps to do here.

The first is the error code that can display the page . If we don't open it, we don't see any error in ASP.

Open our previous step to build a good site

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Double-click ASP

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Click the Debug property, and the " send error to browser " option in this box defaults to false. We changed it to True .


The next step is to change the application pool to enable 32-bit applications , and why do we tell you later.



And the final step is this:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

After you have set up the details, you will see it on your client (including not on the server). or through the phone code inside the return of the results can be normal display error message, debugging procedures must!

2. Installing and configuring the database

I install the oracle10g client here, which is basically the default installation, as if there were only
Installation Type , select Administrator and Oracle Net configuration Assistant: Tick " Run typical configuration " after the database is installed


In the Start menu, select Open Net Configuration Assistant

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Select Local NET service name configuration


Choose to join


Here's the service name to fill it out.


Selecting the default TCP is OK


One thing to note here: Ask your database administrator for the database's intranet IP address and port number; I'm not sure if this is enough to fill out the network address, because our system has done a complex security certification. I write the address of the Internet is not OK, and then the port must be asked clearly.


It is also possible to choose a direct test, but it should be a failure. Because the username and password used are not correct,


Click on the following changes to sign in. Instead of your username and password, and then another test, you should be able to connect successfully.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Next

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">


The net CA is configured here.

3. Configure ODBC


This assumes that you are using ODBC directly from your system. This can happen:


You're going to send it. There is only one SQL Server in the System DSN join now. This is the reason we mentioned in the previous place, 32-bit and 64-bit. There is only one way to solve the problem online:


Find C:/windows/syswow64

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Double hit Open Odbcad32.exe,

You select a System DSN. Choose to join, you can find oracle10g this we need to use the driver


Click Finish

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

In the popup dialog box, the Data Source name is the name we created in the 2nd step, and the TNS service name is selected from the drop-down box in the previous step to build the good one, and the image is the name I created. Click OK, this step is complete.


4. Debug your ASP Web page

A typical test of whether your ASP can successfully connect to a database page such as the following:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Server fills in the first two steps we have the name, and then the UID is your Oracle's username,pwd is password

remember our 1th step in the program pool that changed the Web to support 32-bit? Assuming that there is no such step, your page should have 1 rows of 1,111111, which is what we output, and then a 80004005 error will be prompted .


The reason for the error is that the data source name was not found and the default driver was not specified

Use the method in this webpage to http://blog.snsgou.com/post-619.html. That is what we have dealt with earlier, the program pool is changed to enable 32-bit program is OK.


Suppose you think it's OK to be here, then you're wrong again. After the change, your ASP page will pop up another error:


is still 80004005 error. But the reason for the error is that sqlallochandle on Sql_handle_env failed. Continue Google how to solve, found this page:

Http://bbs.bccn.net/thread-192876-1-1.html

I remember, too. The same problem has occurred previously on Windows Server 2003. At that time also made a lot of and then restarted under the OK, just hold on to try the method, the same steps to operate again. Then reboot, be sure to reboot, OK.

Since Win Server 2003 and 2008 have slightly different settings above this step. Here I will specifically describe the 2008 steps, 03 of the words according to the contents of the link above to do it.

First find your oracle10g installed root folder location, and then right-click oracle10g this folder. Select Properties . Then switch to the Security tab

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Click Edit


Then click Join in the pop-up form


Then in the Select User or group here we want to add two user permissions to go in, here without our input. Click Advanced to find it directly

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

This page pops up. Then click Find Now


Here is a list of all the users on the current server, we found two users, one is highlighted in the figure Iis_iusrs. There is also a picture inside the mouse hover place IUSR

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

After clicking OK. Will give the selected user to join the corresponding permissions, I was doing, there are some files do not have access to the permission. Just ignore it and OK.

The entire process is complete and then back to the Secure Options page. This time click Advanced


In the advanced security settings that pop up, click Change Permissions in the Permissions tab


Select the two users we have just joined. Iis_iusrs and IUSR, and then put the following contained in the object can inherit from the parent of the check box, and then click OK, this time again will be related to the file and directory permissions granted operation, the same or there are several directories do not have access to the permission, It's OK to ignore the same thing.

The last key step to reproduce the server!

。 Be sure to restart server!!

If there is nothing wrong, then OK.


I used this solution, and found the solution on the Internet. No practice. Do not know is not feasible, because my program has been done, it is too lazy to toss, interested students can test:


Here, our entire ASP page link database is all successful!!


Windows server2008 Build ASP Interface access to Oracle database complete process record

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.