ข้ามไปที่เนื้อหาหลัก
การสนับสนุน
ลงชื่อเข้าใช้
ลงชื่อเข้าใช้ด้วย Microsoft
ลงชื่อเข้าใช้หรือสร้างบัญชี
สวัสดี
เลือกบัญชีอื่น
คุณมีหลายบัญชี
เลือกบัญชีที่คุณต้องการลงชื่อเข้าใช้
อังกฤษ
ขออภัย บทความนี้ไม่พร้อมใช้งานในภาษาของคุณ

Symptoms

When you try to modify a record in a table by using the Microsoft OLE DB Provider for SQL Server (SQLOLEDB), you receive the following error message:

Run-time error'-2147467259 (80004005)':
Unspecified error

You receive this message when all the following conditions are true:

  • The table contains a trigger, and the trigger uses a FETCH command.

  • The computer has Microsoft Data Access Components (MDAC) 2.8 installed.

  • The FETCH command does not use its optional INTO clause.

Resolution

To resolve this problem, obtain the latest service pack for Microsoft Windows XP. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

322389 How to obtain the latest Windows XP service pack

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Steps to reproduce the problem

To reproduce the problem, create an update trigger that uses the FETCH command, and then create a Microsoft Visual Basic 6.0 project:

  1. Start SQL Query Analyzer, and then connect to an instance of SQL Server 2000.

  2. On the Query menu, click Change Database. The Select Database of Server name dialog box appears.

    Note Server name is a placeholder for the name of the instance of SQL Server 2000 that you are connected to.

  3. In the Name column, click pubs, and then click OK.

  4. In SQL Query Analyzer, run the following Transact-SQL statement:

    CREATE TRIGGER jobs_Trigger1
    ON dbo.jobs
    FOR UPDATE AS

    BEGIN

    DECLARE @job_id int
    DECLARE job_inserted_cursor CURSOR
    LOCAL
    FAST_FORWARD
    FOR
    Select job_id
    FROM inserted

    OPEN job_inserted_cursor

    FETCH NEXT FROM job_inserted_cursor /* The error occurs. */
    /* FETCH NEXT FROM job_inserted_cursor INTO @job_id The error does not occur. */

    CLOSE job_inserted_cursor
    DEALLOCATE job_inserted_cursor

    END
  5. Start Microsoft Visual Basic 6.0.

  6. In the New Project dialog box, click Standard EXE, and then click Open. By default, a form that is named Form1 is created.

  7. In Project Explorer, right-click the Form1 form, and then click View Code.

  8. Paste the following code in the code window of the Form1 form:

    Dim cn
    Dim rs

    Private Sub Form_Load()
    Set cn = CreateObject("ADODB.Connection")
    cn.Open "Provider=SQLOLEDB;Pwd=<password>;UID=<user name>;Initial Catalog=pubs;Data Source=<data source>"
    cn.CursorLocation = 2
    Set rs = CreateObject("ADODB.Recordset")
    rs.Open "select * from jobs", cn, 1, 3
    rs.MoveLast
    rs(1).Value = "Test"
    rs.Update
    End Sub

    Note password, user name, and data source are placeholders for the password, the user name, and the data source for your environment.

  9. On the Run menu, click Start. You notice the error message that is mentioned in the "Symptoms" section.

References

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:

Installing the OLE DB Provider for SQL Server
http://msdn2.microsoft.com/en-us/library/aa198252(SQL.80).aspx

Triggers
http://msdn2.microsoft.com/en-us/library/aa213995(SQL.80).aspx

Transact-SQL cursors
http://msdn2.microsoft.com/en-us/library/aa172595(SQL.80).aspx

ต้องการความช่วยเหลือเพิ่มเติมหรือไม่

ต้องการตัวเลือกเพิ่มเติมหรือไม่

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

ข้อมูลนี้เป็นประโยชน์หรือไม่

สิ่งที่ส่งผลต่อประสบการณ์ใช้งานของคุณ
เมื่อกดส่ง คำติชมของคุณจะถูกใช้เพื่อปรับปรุงผลิตภัณฑ์และบริการของ Microsoft ผู้ดูแลระบบ IT ของคุณจะสามารถรวบรวมข้อมูลนี้ได้ นโยบายความเป็นส่วนตัว

ขอบคุณสำหรับคำติชมของคุณ!

×