Microsoft Knowledge Base Email Alertz

KBAlertz.com: (228935) - If a WITH statement is used to store an empty string value to one field and an uninitialized string to the very next field, an error will occur when using the Microsoft OLE DB Provider for Jet 3.51 or 4.00 that shipped with MDAC versions prior to 2.5....

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **


Community Site



We Send hundreds of thousands of emails using ASP.NET Email


ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 228935 - Last Review: July 28, 2003 - Revision: 1.2

FIX: Uninitialized String Variables, Empty String Values, Jet Provider, and Errors Occurred

This article was previously published under Q228935

On This Page

SYMPTOMS

If a WITH statement is used to store an empty string value to one field and an uninitialized string to the very next field, an error will occur when using the Microsoft OLE DB Provider for Jet 3.51 or 4.00 that shipped with MDAC versions prior to 2.5. The error that will occur is as follows on version MDAC versions prior to 2.5:
'Errors Occurred'
On MDAC 2.5 installations using the OLE DB Provider for Jet 3.51 the following error will occur:
'Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.'
No error will occur on MDAC 2.5 using the OLE DB Provider for Jet 4.0 that shipped with it, specifically version 4.0.2927.4.

RESOLUTION

If it is still necessary to use the OLE DB Provider for Jet 3.51 or MDAC versions prior to 2.5 then it will be necessary to make sure all variables are properly initialized. Otherwise this problem is resolved in the OLE DB Provider for Jet 4.0 that shipped with MDAC 2.5, specifically version 4.0.2927.4.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

NOTE: Change the DBPath variable to point to an .mdb file.
  1. Start Visual Basic 6.0.
  2. Create a Standard EXE Project.
  3. Set the following Project Reference:
    Microsoft ActiveX Data Objects Library
    						
  4. Paste the following code into the default form:
    Dim CN As ADODB.Connection
    Dim RS As ADODB.Recordset
    Dim strSQL As String
    Dim DBPath As String
    Dim emptystring As String 'If this is initialized it does not error.
    
    'emptystring = ""
    Set CN = New ADODB.Connection
    Set RS = New ADODB.Recordset
    DBPath = "D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB"
        
    On Error Resume Next 'for table drop & creation
    With CN
       .ConnectionString = "Data Source=" & DBPath
       .Provider = "Microsoft.Jet.OLEDB.3.51"
       .Open
       .Execute "drop table testit"
       .Execute "Create table TestIt (Fld1 Text(10), Fld2 Integer, Fld3 Text(10))"
    End With
    On Error GoTo 0 'for table drop & creation
          
    strSQL = "select * from Testit"
    RS.Open strSQL, CN, adOpenKeyset, adLockOptimistic
    RS.AddNew
    
    With RS
        !Fld1 = ""
        !Fld3 = emptystring '"Errors Occurred."
    End With
    					
  5. Run the form.

APPLIES TO
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.01
  • Microsoft ActiveX Data Objects 2.1
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft OLE DB Provider for Jet 3.51
  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.5
Keywords: 
kbbug kbdatabase kbfix kbjet kbmdac250fix kbmdacnosweep KB228935
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please