Several common problems about database when DW does ASP program

Source: Internet
Author: User
Tags anonymous iis odbc odbc connection ole thread volatile access database
Program | data | database | problem

The three-page swordsman with its easy to learn quickly by the broad masses of enthusiasts, especially DW has become the preferred tool for beginners to make Web sites. But when we use DW to make the asp+access program, this or that error often occurs, especially the database is particularly prominent. This paper discusses the causes and solutions of some common problems in this aspect.

  First, the following error occurred while uploading the Web page: Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[Microsoft] [ODBC Driver Manager] did not find a data source name and no default driver specified

Most of these errors occur when you run to the following steps when you build a site with DW, and we select the first or second item, as shown in Figure one:


Figure I

1. When the first item is selected, the ASP program we develop is locally edited and tested. Most database connections are made when you apply a database with a DSN or custom connection string

Use DSN as shown in Figure two:


Figure II

DSN is established with the ODBC Data Source Administrator. We know that DSN has three kinds of User DSN, System DSN, File DSN, in which the User DSN and System DSN can only be used for the current machine and cannot be used by other machines. The second item in the diagram above can only display the System DSN when an ASP program is built with DW, so this problem occurs when we upload an ASP program or run to another machine.

Use the custom connection string as shown in Figure three:


Figure Three

The connection string contains all the information the WEB application needs to connect to the database.

DRIVER Specifies the ODBC driver that is used when no OLE DB provider is specified for the database.

DBQ is the path to a file-based database, such as a database created in Microsoft Access. The path is the path on the server where the database files are being tested.

The following is an example of a connection string that will create an ODBC connection to an Access database named Book.mdb: Driver={microsoft access Driver (*.mdb)};D Bq=d:\book\trees.mdb. Dreamweaver inserts the string in the server-side script so that the application server can then process it. This problem occurs when we upload an ASP program or run to another machine when the path to the test is inconsistent with the database path of the connection string.

2 when the second item is selected, the ASP program we develop is locally edited and uploaded to the remote server for testing. Establishing a database connection also takes the form of a DSN or custom connection string, different from the DSN or connection string on the test server that is used. When using DSN on the test server, you can also use only the System DSN. The same problem arises when you run an ASP program with a machine. The same problem occurs when the path to the test is inconsistent with the database path of the connection string when the custom string is adopted.

From the above analysis, to make yourself using DW development of the ASP program with portability is best to use a custom string (also can use File DSN but for beginners to use custom strings easier). The specific situation is as follows:

This custom connection string can be used for local editing and testing when setting up a site: Driver={microsoft Access Driver (*.mdb)};D Bq=d:\book\trees.mdb (D:\book represents the actual path to the database file ;D and for local editing and uploading to a remote server test, to write a non-DSN connection string to a remote server, you must know the actual path to the file. If you do not know the actual path of the file on the remote server, you can get the path by using the MapPath method in the connection string. Its custom connection string is: If you use VBScript as the scripting language, the connection string can be represented as follows: Driver={microsoft Access Driver (*.mdb)};D bq= "& Server.MapPath ("/ Book/book.mdb "); If you use JavaScript, the expression will be essentially the same, but you want to concatenate two strings with a plus sign (+) instead of A &, and the connection string can be represented as follows: Driver={microsoft Access Driver (* . mdb)};D bq= "+server.mappath ("/book/book.mdb ") so that we can successfully migrate the ASP program (note that the database file must be uploaded to the remote server.) Make a note of its virtual path, such as "/book/book.mdb", or you will get an error. Most of the time when we find that similar error prompts should consider whether or not the problem is due to a database connection, you can use the above method to solve.

  Second, ADODB. One of the Field (0X800A0BCD) BOF or EOF is "true", or the current record has been deleted, and the required operation requires a current record.

This error often results from passing data between Web pages. When we know that ASP applications typically have at least two or more than two Web pages, it is time to consider the process of passing data across multiple Web pages. The common methods of data transmission between Web pages are: URL mode, form method, COOKIE, application, session. The URL mode and form method to achieve simple, can achieve simple data transfer between pages (also we beginners can quickly grasp) and must be continuous access between two pages of data transmission. If you are making a website search engine, you need to use the form to pass parameters. And as we often look at some of the Web site after the user registration, you can see the next page to the user's detailed information. But when we make similar pages with DW, we always have this error. Such errors generally pertain to the recordset (Recordset) problem. This kind of problem occurs because the query condition is usually executed, but the result of return is empty, that is, there is no record to meet the query condition or the loop is executed, the first or last Recordset is executed, and the loop is not terminated in time. So there was a mistake. To resolve this problem, you use data transfer between pages, and you can determine the query criteria using form parameters, URL parameters, or stage variables such as session.

  Iii. common errors caused by open database in DW

1 errors caused by opening the database when you run the program

Microsoft OLE DB Provider for ODBC Drivers error ' 80004005 '

[Microsoft] [ODBC Microsoft Access Driver] Common error cannot open registry key ' temporary (volatile) Jet DSN for process 0xaa0 Thread 0x628 DBC 0x2e80064 J ET '.

2 errors caused by opening the database when uploading files, as shown in Figure four:

  
Figure Four

  Four, can not be updated. Database or object must use an updatable query for read/operate (80004005)

Microsoft OLE DB Provider for ODBC Drivers error ' 80004005 '

[Microsoft] The [ODBC Microsoft Access Driver] operation must use an updatable query.

Microsoft OLE DB Provider for ODBC Drivers error ' 80004005 ' [Microsoft][odbc Microsoft Access Driver] cannot be updated. The database or object is read-only.

1, the most common reason is that the anonymous user account (Iusr_machine) does not have write access to the database file. To resolve this problem, adjust the properties of the database file in the organizer so that anonymous users have the correct permissions. When you use an Access database, you will not only write permissions to the file, but also write permissions to the directory. In IIS, there is a setting, which is the Web Anonymous access user, which is the familiar IUSR_ . Add IUSR_ permissions to your Access database file .

1 This is the Access database file that we want to manipulate using the program

2) Right---> property: "Security" property for this file

3) Increase user IUSR_

4 Set IUSR_ access to access database files

This is a set of permissions note only give IUSR_ read, write permission Oh. Do not give Everyone permission, but also to execute (EXECUTE) permission, so easy to be uploaded by someone else ASP Trojan, and then execute, your system's highest level of access to the intruders were acquired.

2, the reason is that the database does not use the correct mode to open. You should open it using the following method.

Set Conn = Server.CreateObject ("ADODB. Connection ")
Conn.mode = 3 ' 3 = adModeReadWrite
Conn.Open "MyDSN"
Conn.execute (SQL)
Conn.close

Note that the default mode is set 0 (adModeUnknown), which is allowed to be updated.

3. It is also possible to select the Read-only option for this DSN in the ODBC Administrator.

4, you are updating the fields in two tables at the same time, you will also receive this error message, the solution is to update the two tables in separate fields.

5. This error occurs when you use a query that is loaded into a high version (ACCESS 2000) from a lower version (such as access2.0,access7.0).

  V. Microsoft JET Database Engine error ' 80040e09 '

cannot be updated. The database or object is read-only.

A: The database directory does not open read and write permissions. Workaround:

(1) Check that the entire Web site has been opened for write permission in IIS, not just the database file.

(2) Check whether in WIN2000 Explorer, open all permissions for the site's directory to everyone user. To do this, open My Computer----Locate the folder where the Web site is located----Right-click----Select Properties-----Switch to the Security tab, and give everyone permissions here.

Note: If your system is XP, please point to "tools"----"Folder Options"----"View"-----Remove "Use Simple File sharing" before the check, the folder "Properties" dialog box will have the "Security" tab.

  VI. The system cannot open the Registry keyword (8007000e)

Microsoft OLE DB Provider for ODBC Drivers error ' 8007000e '

[Microsoft] [ODBC Microsoft Access Driver] Common error cannot open registry key ' temporary (volatile) Jet DSN for process 0x11b4 Thread 0x1a4c DBC 0x9d34354 Jet '.

Possible causes of error:

1. When you open the database, the standard Access database call is written: (If you can't remember how to write, you can use the help of DW)

"Driver={microsoft Access Driver (*.mdb)};d bq=" & Server.MapPath ("DB. MDB ")

2. Uploading database files.

In short, using DW to make ASP Web site is easier to use the database error, error occurred must see the wrong type, more thinking more advice will be resolved.



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.