win server file upload and download "unspecified error" solution summary

environment

  WIN platform IIS server

    Often appearing on ASPX pages 

Summary

  1. Permission issues

  Appearance scene: Based on ACCESS database

    Reason analysis:

    1. First of all, you need to eliminate your own problems, such as using keywords in table creation, format errors, insert data does not match the database type, etc.

    2.TEMP permission check, when data is written to the database, the current server permission needs to be obtained. Only when the temp write permission of IIS is set can the data be written.

  Solution:

    The first solution: Use "Tools->Database Utilities->Compact and Repair Database" in Ms Access to repair db/global.asa. If there is still an error after repairing, please check whether there is a global.dbl file in the db directory. If there is, delete it. If it cannot be deleted, please end the server w3wp.exe process (win2003) or Aspnet_wp.exe process (win2000) and then delete it.
    Note: This method is suitable for the failure of data writing due to database setting errors, and it is easier to find the problem.


    The second solution:
    set the application pool in the Internet Information Services (IIS) manager, and change the program pool properties of the website as shown in the figure below:     the problem can be solved after adjustment.     Description: The standard IIS server permission setting problem, generally, the operation and maintenance department of the enterprise usually does not have this situation.

    



    The third solution:
    In fact, it only takes a few simple steps:
    start. . . run. . . regsvr32 jscript.dll starts. . .
    run. . . regsvr32 vbscript.dll starts. . .
    run. . . iisreset 

    Description: After a simple Baidu search, REGSVR32 is a system registration and anti-registration tool. This tool is mainly used to repair system files such as the regsvr32 jscript.dll mentioned above. It repairs the local registration problem of the js file, which is equivalent to the concept of re-repairing the reference (not sure ) It contains a lot of tools to check it yourself, the last sentence IISRESET restarts the iis service

  2. System service problems

    Appearing scenes: various file uploads, EXCEL WORD, etc.

    Reason analysis: Most of the uploaded files under the win platform are divided into two types: OLDB and NPOI

      OLDB: When the file is uploaded to the server, the server needs to call its own parser to read the current file and obtain the data in the form of a link string to feed back the DataSet or DataTable data. The underlying code is analyzed as follows  

    

    When the link is made, an exception will be thrown directly. Of course, the above screenshot is only for testing.

  Solution:

    First, if the situation occurs on the production server, the NPOI method is preferred to upload without affecting the normal business. Secondly, after the problem is tracked, the server configuration is compared. If the problem is not changed, compare the win service to determine whether some services are abnormal due to the update, and finally try to solve it.

  Error analysis:

  

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

[OleDbException (0x80004005): 未指定的错误] System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1131233 System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) 


网上的解决方案很多,正确答案原来如此: 

在连接数据库的时候是这么做的: 

public static OleDbConnection getxwdtConn() 

{ 

string connectionstring = WebConfigurationManager.ConnectionStrings["xwdtconnection"].ConnectionString; 

OleDbConnection con = new OleDbConnection(connectionstring); 

return con; 

}

There is no problem in MS sql or Access, and debugging is no problem.

After publishing, there will be an error message like the above.

It is because there must be oledbdatadapter, or dataset, in the operation of the database, and con.open() and con.close() are used.

The specific solution only needs to delete the open and close, because the disconnected connection is used.

If you use static variables instead

 

 

    

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324629703&siteId=291194637