Page 330 of 516« First...102030...328329330331332...340350360...Last »

Description of Access 2002 runtime update: April 30, 2003

Microsoft has released an update to Access 2002 Runtime.
This update contains security enhancements, stability improvements, and
performance improvements.

The Access 2002 Runtime Update includes
stability improvements that were developed as a result of user input from both
the Error Reporting Tool in Microsoft Office XP and Microsoft Product Support
feedback.

Public updates for the Access 2002 Runtime that are released
after this update will require the installation of this update.

This
article describes how to download and how to install the Access 2002 Runtime
Update: KB813617.

Note A later version of the Access 2002 Runtime is
available. For additional information,
click the following article number to view the article in the Microsoft
Knowledge Base:

839022 

(http://support.microsoft.com/kb/839022/
)

How to obtain the latest Office XP Service Pack for Access 2002 Runtime

How to Download and How to Install the Update

Important Before you install this update, make sure that you meet the
following requirements:

  • Microsoft Windows Installer 2.0

    Before you install
    this update, you must install Windows Installer 2.0 or later. For additional
    information about this requirement, see the “Windows Installer Update
    Requirements” section of this article.

  • Microsoft Access 2002 Runtime

Updating Existing Run-time Applications

You can use either of the following two options:

  • Direct Users to the Microsoft Office Product Updates Web
    Site
  • Distribute the Access 2002 Runtime Client Update

Direct Users to the Microsoft Office Product Updates Web Site

One option for updating computers is to have each user
move to the Microsoft Office Products Updates Web site and then download the
update. If you do not know what updates users may have applied, this option is
an efficient way to make sure that all users have the most current version of
the software and any new security updates. To use this option, make sure that
each user follows these steps:

Note After you install the update, you cannot remove it. To revert to
an installation before the update was installed, you must remove the Access
run-time application and then install it again from the original source.
Remember to back up any data files before you remove the Access run-time
application.

  1. Visit the Microsoft Office Products Updates Web site:
  2. Click Check for Updates.
  3. Click to check Access 2002 Runtime Update:
    KB813617
    and then click Start Installation.
  4. Click to check the I accept the terms of the
    license agreement
    check box and then click
    Next.
  5. Click Next two times.
  6. Click Finish.

Distribute the Access 2002 Runtime Client Update

Another option for updating computers is to download and
to distribute the client update to users. To use this option, follow these
steps:

Note After you install the update, you cannot remove it. To revert to
an installation before the update was installed, you must remove the Access
run-time application and then install it again from the original source.
Remember to back up any data files before you remove the Access run-time
application.

  1. Download the following file from the Microsoft Download
    Center:
  2. Distribute the file
    Access2002-runtime-kb813617-client-enu.exe to the users.
  3. The users must open Microsoft Windows Explorer,
    double-click Access2002-runtime-kb813617-client-enu.exe, and
    then follow the steps to complete the installation.

How to Determine Whether the Update Is Installed

The update contains updated versions of the following
files:

    File name      Version
    -----------------------
    Graph.exe     10.0.4109.0
    Intldate.dll  2.0.0.1930
    Msaccess.exe  10.0.4302.0
    Msaexp30.dll  10.0.4016.0
    Mscal.ocx     10.0.0.4024
    MSCDM.dll     10.0.0.3506
    Mscomctl.ocx  6.1.95.45
    Msdmeng.dll   8.0.534.0
    Msdmine.dll   8.0.534.0
    Msdmine.rll   8.0.534.0
    Msmdcb80.dll  8.0.384.0
    Msmdgd80.dll  8.0.534.0
    Msmdun80.dll  2000.80.382.0
    Mso.dll       10.0.4219.0
    Msolap80.dll  8.0.534.0
    Msolap80.rll  8.0.384.0
    Msolui80.dll  8.0.0.382
    Msowc.dll     9.0.0.6430
    Olapuir.rll   8.0.382.0
    Owc10.dll     10.0.4109.0
    Snapview.ocx  10.0.4115.0
    Soa.dll       10.0.4115.0

To determine if the update is installed on your computer,
follow these steps:

Note Because there are several versions of Microsoft Windows, the
following steps may be different on your computer. If they are, see your
product documentation to complete these steps.

  1. Click Start, and then click
    Search.
  2. In the search results pane under Search
    Companion
    , click All files and folders.
  3. In the All or part of the file name box,
    type Msaccess.exe, and then click
    Search
    .
  4. In the list of files, right-click
    Msaccess.exe, and then click Properties.
  5. Click the Version tab, if the version
    number is 10.0.4302.0 or later, the update is installed on your computer.

Note If the Access 2002 Runtime Update: KB813617 is already installed
on your computer, you may receive the following error message when you try to
install the Access 2002 Runtime Update: KB813617:

This update has already been applied or is included in an update
that has already been applied.

Windows Installer Update Requirements

To install the update that is described in this article requires
Windows Installer 2.0 or later. Both Microsoft Windows XP and Microsoft Windows
2000 Service Pack 3 (SP3) include Windows Installer 2.0 or later.

For
additional information about how to install the latest version of Windows
Installer for Microsoft Windows 95, Microsoft Windows 98, and Microsoft Windows
Millennium Edition (Me), visit the following Microsoft Web site:

For additional information about how to install the latest version
of Windows Installer for Microsoft Windows NT 4.0 and Windows 2000, visit the
following Microsoft Web site:

Issues That Are Fixed by the Update

The Access 2002 Runtime Update: KB813617 updates the Access 2002
Runtime files to a version level that is equal to the level of the same files
that are updated by Office XP Service Pack 2 (SP-2).
For additional information about Office XP Service
Pack 2 and what Access 2002 Runtime issues are fixed by Office XP Service Pack
2, click the following article number to view the article in the Microsoft
Knowledge Base:

325671 

(http://support.microsoft.com/kb/325671/EN-US/
)

OFFXP: Overview of the Office XP
Service Pack 2

Excerpt from:
Description of Access 2002 runtime update: April 30, 2003

You receive an "unspecified error" error message when you create more than 64 connections to an Access Database in one process

Imports System.Data.OleDb
Module Module1

  Sub Main()
    Dim intCount As Integer
    Dim intMaxConnections As Integer
    Dim strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
        & "Data Source=C:Program FilesMicrosoft " _
        & "OfficeOffice10SamplesNorthwind.mdb;"

    intMaxConnections = 65

    Dim IntArray(intMaxConnections) As Object
    Console.WriteLine("Starting test...")
    For intCount = 0 To intMaxConnections
      Try
        Dim objConnection As New OleDbConnection(strConnection)
        objConnection.Open()
        Console.WriteLine("Open connection is " & intCount)
        IntArray(intCount) = objConnection
      Catch excpt As Exception
        Console.WriteLine("Exception " + excpt.Message.ToString())
      End Try
    Next
  End Sub

End Module

Read the article:
You receive an "unspecified error" error message when you create more than 64 connections to an Access Database in one process

Error message when you run a procedure in Access: "Ambiguous name detected"

When you run a procedure in Microsoft Access 2000 or later,
you may receive the following error message:

The
expression Event_Name you entered as the event
property setting produced the following error: Ambiguous name detected:
EventProcedure_Name.

This error occurs when there are multiple procedures with
the same name in a module.
To work around this problem, delete the unwanted duplicate
procedure. To do this, follow these steps:

  1. Open the form in Design view.
  2. In
    Microsoft Office Access 2003, click Code on
    the View menu.

    In
    Microsoft Office Access 2007, click
    View Code in the Tools group on the Design tab.

  3. On the Debug menu, click Compile
    Database Name
    .

    You receive the
    following error message:

    Compile error: Ambiguous name
    detected: Procedure Name.

  4. Notice the procedure name, and then click
    OK.
  5. In the code, find the other occurrences of the
    Procedure Name procedure, where
    Procedure Name produced the compile error mentioned
    in step 3.
  6. Select and then delete the unwanted procedure.
  7. On the Debug menu, click Compile
    Database Name
    .
  8. On the File menu, click
    Close.
For additional information, click the following article number to view the
article in the Microsoft Knowledge Base:
209907 

(http://support.microsoft.com/kb/209907/EN-US/
)

ACC2000: Compile Error After Converting Form Macros to VBA

See more here:
Error message when you run a procedure in Access: "Ambiguous name detected"

"Numeric Field Overflow" error message occurs when you query a table that is linked to Excel spreadsheet

When you query a table that is linked to a Microsoft Excel
spreadsheet, you may receive the following error message:
Access assigns a data type for each field of the Excel
spreadsheet. This assignment is based on the data that is contained in the
first eight rows. For example, if a field has a Number data type that is in the first eight rows and then has text
values in some of the remaining rows, Access assigns the Number data type to the link table field. This causes Access to fail to
link the records that have text data values. When you query this field,
Microsoft Jet Database Engine encounters text where a number is expected. The
query fails with the error message in the “Symptoms” section.
To work around this problem, you must make sure that the
data values in each field of the source Excel spreadsheet are exactly the same
data type. Or, if the fields of the Excel spreadsheet contains data values of a
mixed data type, then format the field as Text. Use the following code to reenter the values in the cells. Then,
link the Excel spreadsheet to Access. To do this, follow these steps:

Note Before you start these steps, you must backup your Excel
spreadsheet.

  1. Open the source spreadsheet in Excel.
  2. In the spreadsheet, identify the fields that have data
    values of mixed data types.
  3. Select the identified columns and then format the cells in
    the spreadsheet as Text.
  4. Create a macro in Excel that contains the following
    procedure:
    Sub Addspace()
    
    Dim cell As Object
    
    For Each cell In Selectioncell.Value = " " & cell.Valuecell.Value = Right(cell.Value, Len(cell.Value) - 1)Next
    
    End Sub
    
    

  5. Select the fields in the spreadsheet that contain data
    values of mixed data types. Run the macro that you created in step 4.

    Note If an error occurs when you run the macro on the problem cells,
    ignore the error.

  6. Save the spreadsheet.
  7. Open your database in Access.
  8. From your database, link to the source spreadsheet in
    Excel.
When you import, do not link an Excel spreadsheet. This is
because the Text data type has a priority in the import algorithm. For example, if
the predominant data type that is based on a sampling of data is numeric, but
there is at least one text value in that sample, Access imports the whole field
as Text.

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

282263 

(http://support.microsoft.com/kb/282263/
)

ACC2002: Ignored MaxScanRows Setting May Cause Improper Data Types in
Linked Tables

208414 

(http://support.microsoft.com/kb/208414/EN-US/
)
ACC2000: #Num Appears in Linked Microsoft Excel Spreadsheet

For more information about how to create a
macro in Microsoft Excel, click Microsoft Excel Help on the
Help menu, type Create a macro in the
Office Assistant or the Answer Wizard, and then click Search
to view the topic.
For more information about how to run a macro in Microsoft
Excel, click Microsoft Excel Help on the Help
menu, type Run a macro in the Office Assistant or the
Answer Wizard, and then click Search to view the topic.

Follow this link:
"Numeric Field Overflow" error message occurs when you query a table that is linked to Excel spreadsheet

Error message when you programmatically add a new record to a table by using the NotInList event of the Combo Box on a form in Microsoft Access: "The Text You Entered Isn’t an Item in the List"

Article ID: 824176 – Last Review: September 17, 2011 – Revision: 3.0

This article applies only to a
Microsoft Access database (.mdb).

For a Microsoft Access 97 version of this article,
see
161007 

(http://support.microsoft.com/kb/161007/
)
.

Moderate: Requires basic macro, coding, and interoperability
skills.

When you try to programmatically add a new record to a table
by using the NotInList event of the combo box on a form, you might receive the following
error message:
The text you entered isn’t an item in the
list.

Select an item from the list, or type the text that matches one
of the listed items.

However, the new record is successfully added to
the table. As a result, the new item that you entered is added to the list of
items in the combo box.

This problem occurs when the combo box is bound to a Number data type column and the format property for the column is set to
Currency or to Euro.
To work around this problem, type the value in the combo box
that matches the format of the column that the combo box is bound to. For
example, if the format of the column is Currency, type $20 instead of
20.

However, if the format of the column is set
to Euro, you might not be able to enter a number that matches the format
of the column.

Note If you reset the Format property of the column,
the problem does not occur.

You might also receive the error message when you type a
number that corresponds to an item in the combo box that already exists. This
problem might occur if the number that you type does not match the formatted
entries of the underlying recordset that already exists.

Steps to reproduce the behavior in Microsoft Office Access 2003

  1. Start Microsoft Access.
  2. Create a new Db1.mdb database.
  3. To create the required sample table, follow these steps:
    1. In the Database window, click Tables
      under Objects.
    2. In the right pane, double-click Create table in
      Design view
      .
    3. In the first row of the Field Name
      column, type ID, and then set the corresponding
      Data Type to AutoNumber.
    4. In the second row of the Field Name
      column, type Rates, and then set the corresponding
      Data Type to Number.
    5. In the Field Properties pane, click
      the General tab.
    6. Set the Format property to
      Currency.
    7. On the File menu, click
      Save.
    8. In the Save As dialog box, type
      Rates, and then click OK.
    9. On the File menu, click
      Close.
  4. In the Database window, click Forms under
    Objects.
  5. In the right pane, double-click Create form in
    Design view
    .
  6. Add a ComboTest combo box to the form, and
    then set the properties as follows:

    Collapse this tableExpand this table

    Name: ComboTest
    Bound Column: 1
    RowSourceType: Table/Query
    Row Source: SELECT Rates.ID, Rates.Rates FROM
    Rates;
    Auto Expand: Yes
    Limit to List: Yes
    Column Count: 2
    Column Widths: 0″;1″
  7. On the View menu, click
    Code to open the Microsoft Visual Basic Editor.
  8. Paste the following code in the NotInList
    event of the ComboTest combo box.
    Note The sample code in this article uses Microsoft Data Access
    Objects. For this code to run correctly, you must reference the Microsoft DAO
    3.6 Object Library. To do so, click References on the
    Tools menu in the Visual Basic Editor, and make sure that the
    Microsoft DAO 3.6 Object Library check box is selected.

       Dim Db As DAO.Database
       Dim Rs As DAO.Recordset
       Dim Msg As String
    
           Msg = "'" & NewData & "' is not in the list." & vbCr & vbCr
           Msg = Msg & "Do you want to add it?"
           If MsgBox(Msg, vbQuestion + vbYesNo) = vbNo Then
               Response = acDataErrContinue
              MsgBox "Try again."
           Else
               Set Db = CurrentDb
               Set Rs = Db.OpenRecordset("Rates", dbOpenDynaset)
    
               Rs.AddNew
               Rs!Rates = NewData
               Rs.Update
               Response = acDataErrAdded
    
           End If

  9. On the File menu, click
    Save.
  10. In the Save As dialog box, type
    FormTest, and then click OK.
  11. On the File menu, click
    Close.
  12. In the right pane of the Database window, double-click
    FormTest.
  13. Type a number in the combo box, and then press the ENTER
    key.

    The NotInList event is triggered. You receive
    the error message that is mentioned in the “Symptoms” section of this
    article.

For more
information about the NotInList event, click Microsoft Access
Help
on the Help menu, type NotInList
Event
in the Office Assistant or the Answer Wizard, and then click
Search to view the topic.

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

197526 

(http://support.microsoft.com/kb/197526/
)

ACC2000: Use NotInList Event to Add a Record to Combo Box



APPLIES TO
  • Microsoft Office Access 2007
  • Microsoft Office Access 2003
  • Microsoft Access 2002 Standard Edition
  • Microsoft Access 2000 Standard Edition
kbtshoot kbexpertiseinter kbformat kbevent kberrmsg kbdatabinding kbcombobox kbprb KB824176

Other Resources

Other Support Sites

Community

Get Help Now

Article Translations

See the original post:
Error message when you programmatically add a new record to a table by using the NotInList event of the Combo Box on a form in Microsoft Access: "The Text You Entered Isn’t an Item in the List"

The data in a linked Excel spreadsheet column is truncated to 255 characters in an Access database

When you link to a Microsoft Office Excel spreadsheet from a
Microsoft Office Access database, and the columns of the Excel spreadsheet contain
more than 255 characters, you may notice that the data in the linked table
appears truncated after the 255th character.
In Access, when you link to an Excel spreadsheet that
contains more than 255 characters, the column of the Excel spreadsheet is
mapped to the formatted Memo data type. Because Access treats the formatted
Memo field as a text field that has a 255-character limit, you can view only
255 characters. However, the data is not physically truncated in the linked
table.
To work around this problem, you must import the Excel
spreadsheet to an Access table when the columns of the Excel spreadsheet
contain more than 255 characters.
This
behavior is by design.
In Access, you can set the Format property of the Text field and the Memo field to create custom
formats. You can use the following special characters to set the Format property of the Text field and the Memo field:

Collapse this tableExpand this table

Special character Description
@ Text character. Either a character or a space is
required.
& Text character is not required.
< Force all characters to lowercase.
> Force all characters to uppercase.

When you link an Excel spreadsheet to an Access database, and
the columns of the Excel spreadsheet contain more than 255 characters, the
columns are mapped to Memo data types, and the Format property of the Memo field is set to @. Therefore, Access treats
the Memo field as a text field, and you can view only 255 characters of
data.

However, when you import an Excel spreadsheet that has columns
that contain more than 255 characters, the columns are mapped to a Memo field
with no specific format. Therefore, you can view the complete data in the
field.

For additional information about how to import or link data
from a spreadsheet, visit the following Microsoft Web site: For additional information about a formatted Memo field,
click the following article number to view the article in the Microsoft
Knowledge Base:
259893 

(http://support.microsoft.com/kb/259893/
)

Formatted Memo field
appears to truncate data after 255 characters

More:
The data in a linked Excel spreadsheet column is truncated to 255 characters in an Access database

How to import data from Excel to SQL Server

This step-by-step article demonstrates how to import data from Microsoft Excel worksheets into Microsoft SQL Server databases by using a variety of methods.

Description of the Technique

The samples in this article import Excel data by using:

  • SQL Server Data Transformation Services (DTS)
  • Microsoft SQL Server 2005 Integration Services (SSIS)
  • SQL Server linked servers
  • SQL Server distributed queries
  • ActiveX Data Objects (ADO) and the Microsoft OLE DB Provider for SQL Server
  • ADO and the Microsoft OLE DB Provider for Jet 4.0

Requirements

The following list outlines the recommended hardware, software, network infrastructure, and service packs that are required:

  • Available instance of Microsoft SQL Server 7.0 or Microsoft SQL Server 2000 or Microsoft SQL Server 2005
  • Microsoft Visual Basic 6.0 for the ADO samples that use Visual Basic

Portions of this article assume that you are familiar with the following topics:

  • Data Transformation Services
  • Linked servers and distributed queries
  • ADO development in Visual Basic

Samples

Import vs. Append

The sample SQL statements that are used in this article demonstrate Create Table queries that import Excel data into a new SQL Server table by using the SELECT…INTO…FROM syntax. You can convert these statements to Append queries by using the INSERT INTO…SELECT…FROM syntax while you continue to reference the source and destination objects as shown in these code samples.

Use DTS or SSIS

You can use the SQL Server Data Transformation Services (DTS) Import Wizard or the SQL Server Import and Export Wizard to import Excel data into SQL Server tables. When you are stepping through the wizard and selecting the Excel source tables, remember that Excel object names that are appended with a dollar sign ($) represent worksheets (for example, Sheet1$), and that plain object names without the dollar sign represent Excel named ranges.

Use a Linked Server

To simplify queries, you can configure an Excel workbook as a linked server in SQL Server.

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

306397 

(http://support.microsoft.com/kb/306397/EN-US/
)
HOWTO: Use Excel with SQL Server Linked Servers and Distributed Queries

The following code imports the data from the Customers worksheet on the Excel linked server “EXCELLINK” into a new SQL Server table named XLImport1:

SELECT * INTO XLImport1 FROM EXCELLINK...Customers$
				

You can also execute the query against the source in a passthrough manner by using OPENQUERY as follows:

SELECT * INTO XLImport2 FROM OPENQUERY(EXCELLINK,
    'SELECT * FROM Customers$')
				

Use Distributed Queries

If you do not want to configure a persistent connection to the Excel workbook as a linked server, you can import data for a specific purpose by using the OPENDATASOURCE or the OPENROWSET function. The following code samples also import the data from the Excel Customers worksheet into new SQL Server tables:

SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:testxltest.xls;Extended Properties=Excel 8.0')...Customers$

SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:testxltest.xls', Customers$)

SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:testxltest.xls', 'SELECT * FROM Customers$')
				

Use ADO and SQLOLEDB

When you are connected to SQL Server in an ADO application by using Microsoft OLE DB for SQL Server (SQLOLEDB), you can use the same “distributed query” syntax from the Using Distributed Queries section to import Excel data into SQL Server.

The following Visual Basic 6.0 code sample requires that you add a project reference to ActiveX Data Objects (ADO). This code sample also demonstrates how to use OPENDATASOURCE and OPENROWSET over an SQLOLEDB connection.

    Dim cn As ADODB.Connection
    Dim strSQL As String
    Dim lngRecsAff As Long
    Set cn = New ADODB.Connection
    cn.Open "Provider=SQLOLEDB;Data Source=;" & _
        "Initial Catalog=;User ID=;Password=
"

    'Import by using OPENDATASOURCE.
    strSQL = "SELECT * INTO XLImport6 FROM " & _
        "OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', " & _
        "'Data Source=C:testxltest.xls;" & _
        "Extended Properties=Excel 8.0')...Customers$"
    Debug.Print strSQL
    cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
    Debug.Print "Records affected: " & lngRecsAff

    'Import by using OPENROWSET and object name.
    strSQL = "SELECT * INTO XLImport7 FROM " & _
        "OPENROWSET('Microsoft.Jet.OLEDB.4.0', " & _
        "'Excel 8.0;Database=C:testxltest.xls', " & _
        "Customers$)"
    Debug.Print strSQL
    cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
    Debug.Print "Records affected: " & lngRecsAff

    'Import by using OPENROWSET and SELECT query.
    strSQL = "SELECT * INTO XLImport8 FROM " & _
        "OPENROWSET('Microsoft.Jet.OLEDB.4.0', " & _
        "'Excel 8.0;Database=C:testxltest.xls', " & _
        "'SELECT * FROM Customers$')"
    Debug.Print strSQL
    cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
    Debug.Print "Records affected: " & lngRecsAff

    cn.Close
    Set cn = Nothing
				

Use ADO and the Jet Provider

The sample in the preceding section uses ADO with the SQLOLEDB Provider to connect to the destination of your Excel-to-SQL import. You can also use the OLE DB Provider for Jet 4.0 to connect to the Excel source.

The Jet database engine can reference external databases in SQL statements by using a special syntax that has three different formats:

  • Full path to Microsoft Access database.Table Name
  • ISAM Name;ISAM Connection String.Table Name
  • ODBC;ODBC Connection String.Table Name

This section uses the third format to make an ODBC connection to the destination SQL Server database. You can use an ODBC Data Source Name (DSN) or a DSN-less connection string:

DSN:
    odbc;DSN=;UID=;PWD=


DSN-less:
   odbc;Driver=SQL Server;Server=;Database=;
       UID=;PWD=

				

The following Visual Basic 6.0 code sample requires that you add a project reference to ADO. This code sample demonstrates how to import Excel data to SQL Server over an ADO connection by using the Jet 4.0 Provider.

    Dim cn As ADODB.Connection
    Dim strSQL As String
    Dim lngRecsAff As Long
    Set cn = New ADODB.Connection
    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=C:testxltestt.xls;" & _
        "Extended Properties=Excel 8.0"

    'Import by using Jet Provider.
    strSQL = "SELECT * INTO odbc;Driver=SQL Server;" & _
        "Server=;Database=;" & _
        "UID=;PWD=
.XLImport9 " & _
        "FROM Customers$"
    Debug.Print strSQL
    cn.Execute strSQL, lngRecsAff, adExecuteNoRecords
    Debug.Print "Records affected: " & lngRecsAff

    cn.Close
    Set cn = Nothing
				

You can also use this syntax, which the Jet Provider supports, to import Excel data into other Microsoft Access databases, indexed sequential access method (ISAM) (“desktop”) databases, or ODBC databases.

Troubleshooting

  • Remember that Excel object names that are appended with a dollar sign ($) represent worksheets (for example, Sheet1$) and that plain object names represent Excel named ranges.
  • In some circumstances, especially when you designate the Excel source data by using the table name instead of a SELECT query, the columns in the destination SQL Server table are rearranged in alphabetical order.For additional information about this problem with the Jet Provider, click the article number below
    to view the article in the Microsoft Knowledge Base:

    299484 

    (http://support.microsoft.com/kb/299484/EN-US/
    )
    PRB: Columns Are Sorted Alphabetically When You Use ADOX to Retrieve Columns of Access Table
  • When the Jet Provider determines that an Excel column contains mixed text and numeric data, the Jet Provider selects the “majority” data type and returns non-matching values as NULLs.For additional information about how to work around this problem, click the article number below
    to view the article in the Microsoft Knowledge Base:

    194124 

    (http://support.microsoft.com/kb/194124/EN-US/
    )
    PRB: Excel Values Returned as NULL Using DAO OpenRecordset

For additional information about how to use Excel as a data source, click the article number below
to view the article in the Microsoft Knowledge Base:

257819 

(http://support.microsoft.com/kb/257819/EN-US/
)
HOWTO: Use ADO with Excel Data from Visual Basic or VBA

For additional information about how to transfer data into Excel, click the article numbers below
to view the articles in the Microsoft Knowledge Base:

295646 

(http://support.microsoft.com/kb/295646/EN-US/
)
HOWTO: Transfer Data from ADO Data Source to Excel with ADO
247412 

(http://support.microsoft.com/kb/247412/EN-US/
)
INFO: Methods for Transferring Data to Excel from Visual Basic
246335 

(http://support.microsoft.com/kb/246335/EN-US/
)
HOWTO: Transfer Data from an ADO Recordset to Excel with Automation
319951 

(http://support.microsoft.com/kb/319951/EN-US/
)
HOW TO: Transfer Data to Excel by Using SQL Server Data Transformation Services
306125 

(http://support.microsoft.com/kb/306125/EN-US/
)
HOW TO: Import Data from SQL Server into Microsoft Excel

See more here:
How to import data from Excel to SQL Server

BUG: An "Object reference not set to an instance of an object" error occurs when you try to access data by using ADO Interop on an ASP.NET page

On a computer that has Microsoft .NET Framework 1.0
installed (and that does not have Microsoft Visual Studio .NET installed), when you try to
access data using ADO Interop on an ASP.NET page that resides at an identical site
and that is hosted on the same computer, you may receive the following error
message:

Exception Details:
System.NullReferenceException: Object reference not set to an instance of an
object.

To resolve this problem, register the Adodb.dll file in the
global assembly cache (GAC). On a computer where only the .NET Framework is
installed, the file Gacutil.exe does not exist.. Either obtain the gacutil file
by installing Microsoft .NET Framework SDK, or create a Visual Studio.NET setup
project that uses the installer to install the correct components.

To
register Adodb.dll in the GAC, follow these steps:

  1. Click Start and then click
    Run.
  2. In the Run dialog box, type the following
    command, and then click OK:


    C:WINDOWSMicrosoft.NETFrameworkv1.0.3705gacutil /i C:Program
    FilesMicrosoft.NETPrimary Interop Assembliesadodb.dll

Microsoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
For more information about registering .dll files in the
GAC, visit the following Microsoft Web site:

View post:
BUG: An "Object reference not set to an instance of an object" error occurs when you try to access data by using ADO Interop on an ASP.NET page

You may receive an error message when you try to insert a new record in a table that contains an Autonumber field in Access 2007 or in Access 2003

Article ID: 884185 – Last Review: September 17, 2011 – Revision: 7.0

When you try to insert a new record in a table that has an
Autonumber field, you may receive the following error message:

The changes you requested to the table were not successful because
they would create duplicate values in the index, primary key, or relationship.
Change the data in the field or fields that contain duplicate data, remove the
index, or redefine the index to permit duplicate entries and try
again.

Note The table may not have any relationships or any
indexes.

This problem occurs in Microsoft Office Access
2007 or in Microsoft Office Access
2003.

This problem may occur when the following conditions are
true:

  • The Access database was compacted.
  • The table contains an Autonumber field that is not
    correctly reseeded.
  • You install Microsoft Jet 4.0 Database Engine Service Pack
    8 (SP8).
  • You append data from linked table 1 to linked table 2 by
    using the Current Database option instead of the
    Another Database option. Then you delete the record from
    linked table 1 and reappend the same record from linked table 2 by using the
    Current Database option.

Access 2007

Re-create the Append queries in the dbFrontEnd.accdb database. To do this, click Append in the Query Type group on the Design tab, and then click Another Database.

Access 2003

Re-create the Append queries in the dbFrontEnd.mdb database.
To do this, click Append Query on the Query
menu in query design view, and then click Another
database
.

To work around this problem, you must compact the database
and then reset the Autonumber field seed. To compact the database, follow these
steps:

  1. Start Access.
  2. Open the Access database.

    Note If you see the Security Warning dialog box, click Open.

  3. Access 2007
    • Click the Microsoft Office Button, point to Manage, and then click Compact and Repair Database.

    Access 2003

    • On the Tools menu, click Database
      Utilities
      , and then click Compact and Repair
      Database
      .
  4. If you see the Security Warning dialog
    box, click Open.

To reset the Autonumber field seed, use one of the following
methods.

Method 1: Use a Data Definition query

Open the database that has the table (back-end database) in Access 2007

  1. On the Create tab, click Query Design in the Other group.
  2. In the Show Table dialog box, click Close.
  3. On the Design tab, click SQL view in the Results group.
  4. Type the following in the Query1 window:

    ALTER TABLE TableName
    ALTER COLUMN AutoNumFieldName
    COUNTER(iMaxID,1);

    NoteTableName is a placeholder for the name
    of the table.AutoNumFieldName is a placeholder for the name of the Autonumber field. iMaxID is a placeholder for the current maximum value in the field plus 1.

  5. On the Design tab, click Run in the Results group.

Access 2003

  1. In the Database window, click Queries
    under Objects.
  2. Click New, click Design
    View
    , and then click OK.
  3. In the Show Table dialog box, click
    Close.
  4. On the Query menu, click SQL
    Specific
    , and then click Data Definition.
  5. In the Data Definition Query window, type the
    following:

    ALTER TABLE TableName
    ALTER COLUMN AutoNumFieldName
    COUNTER(iMaxID,1);

    Note The placeholder TableName represents the name
    of the table. The placeholder AutoNumFieldName represents the
    name of the Autonumber field. The placeholder iMaxID represents the current maximum value in the field plus 1.

  6. On the Query menu, click
    Run.

Method 2: Run Visual Basic for Applications code

  1. Access 2007
    • On the Create tab, click the down arrow under Macro, and then click Module.

    Access 2003

    • In the Database window, click Modules
      under Objects, and then click New.
  2. Paste the following code in the Visual Basic Editor.
    Sub ResetAuto()
    
    Dim iMaxID As Long
    Dim sqlFixID As String
    
      iMaxID = DMax("", "") + 1
    
      sqlFixID = "ALTER TABLE  ALTER COLUMN  COUNTER(" &  & ",1)"
    
      DoCmd.RunSQL sqlFixID
    
    End Sub

    Note The placeholder represents
    the name of the Autonumber field. The placeholder represents the name of the table.

  3. On the Run menu, click Run
    Sub/UserForm
    .

Note You must close the table before you use either method. You do not
have to save the query or the module after you successfully use either
method.

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

Steps to reproduce the behavior in Access 2003

  1. Create two new blank databases, and name them dbBE1.mdb and
    dbBE2.mdb.
  2. In the dbBE1.mdb database, create a new table that is named
    Table1 that contains the following two fields:

    • Field1: Autonumber (Primary Key)
    • Field2: Text
  3. Add the following six records to Table1.

    Collapse this tableExpand this table

  4. In the dbBE2.mdb database, create a new table that is named
    tblArchive that contains the following two fields:

    • Field1: Number
    • Field2: Text
  5. Create a new blank database and name it
    dbFrontEnd.mdb.
  6. In the dbFrontEnd.mdb database, create a new link table to
    the Table1 table in the dbBE1.mdb database.
  7. In the dbFrontEnd.mdb database, create another new link
    table to the tblArchive table in the dbBE2.mdb database.
  8. In the dbFrontEnd.mdb database, create a new append query
    based on Table1 in design view.

    1. Add all fields from Table1 to the design
      grid.
    2. On the Query menu in query design view
      click Append query.
    3. In the Append To box, type
      tblArchive as the table name.
    4. Click Current Database, and then click
      OK.
    5. In the Criteria row for Field1, type
      3.
    6. Run the new query. You see that record 3 is appended to
      the tblArchive table.
  9. Delete record 3 from Table1.
  10. In the dbFrontEnd.mdb database, create a new append query
    that is based on the tblArchive table in design view.

    1. Add all fields from the tblArchive table to the design
      grid.
    2. On the Query menu in query design
      view, click Append query.
    3. In the Append To box, type
      Table1 as the table name.
    4. Click Current Database, and then click
      OK.
    5. In the Criteria row for Field1, type
      3.
    6. Run the new query. You see that record 3 is appended
      back to the Table1 table.
  11. Open Table1, and then try to add a new record. You receive
    the error message that is mentioned in the “Symptoms” section.

For more information about Microsoft Jet 4.0 Database Engine Service Pack 8, click the following article number to view the article in the Microsoft Knowledge Base:

829558 

(http://support.microsoft.com/kb/829558/
)

Information about Jet 4.0 Service
Pack 8



APPLIES TO
  • Microsoft Office Access 2007
  • Microsoft Office Access 2003
kberrmsg kbcorrupt kbbug kbtshoot kbprb KB884185

Other Resources

Other Support Sites

Community

Get Help Now

Article Translations

See the original article here:
You may receive an error message when you try to insert a new record in a table that contains an Autonumber field in Access 2007 or in Access 2003

Access exports long integer numbers as double data type with decimal places in dBase IV (.dbf) format

When you create a Microsoft Office Access table that contains long integer
numbers and then you export that table as type dBase IV (.dbf), the numbers are
converted to double data type and will show decimal places.

For example,
you may export the following table:

UNITS
23411
111111111
1121212

When you then import and view the data in dBase IV, the
data appears similar to the following:

UNITS
23411.00000
111111111.00000
1121212.00000

Note When you create a number field in a table in Access, you use the
FieldSize property to control the amount of space that is allocated for a
particular field. For number fields, you can choose one of the following numeric types from a list:

  • Byte
  • Integer
  • Long Integer
  • Single
  • Double
  • ReplicationID
  • Decimal

By default, the setting for number fields is Long Integer. The Long
Integer value stores whole numbers that range from about –2 billion to +2 billion.
Or, you can choose the Double value to store numbers with decimals.

This problem occurs because there is no Integer data type
in dBase. dBase uses either Numeric or Float data types. Access maps Long Integers to the
Numeric data type in dBase.
To work around this problem, use one of the following methods:

Method 1: Modify the database file in dBase

Modify the design of the database file after it has been added to
the dBase catalog. For example, set the Dec column to 0 (zero). For additional
information about designing database files in dBase, see the dBase
documentation.

Method 2: Use Microsoft Office Excel to format the data

Use Excel to format the data in the table that you
exported. To do this, follow these steps:

  1. In Excel, open the table that you exported as type dBase
    IV (*.dbf) from Access.
  2. Format the cells that are not correctly formatted. To do
    this, select the cells, and then click Cells on the
    Format menu.
  3. After you have formatted the cells, export the spreadsheet
    as a dBase IV file. To do this, follow these steps:
    1. On the File
      menu, click Save As.
    2. In the Save as
      type
      box, click DBF 4 (dbase IV) (*.dbf), and then click Save.

Method 3: Use sample code to format the data

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

You can use the following code sample to automate
the process of formatting the data. The sample will save a table as a text
file. Then, it will automate Excel to open the text file and then save it in dBase IV
format.

Note You must change the file names in this code sample to match your
file names.

Sub exportFormat() 

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook 

Const SAVETEXT = "C:testValues.txt"
Const SAVEDBF = "C:testDBF.dbf" 

' Save the table as a text file.
DoCmd.TransferText acExportDelim, , "Table1", SAVETEXT, True 

' Set a reference to the Application object.
Set xlApp = CreateObject("Excel.Application") 

' Set a reference to the Workbook object.
Set xlBook = xlApp.Workbooks.Open(SAVETEXT, , , 2) 

' Save the file to dBase IV format.
xlBook.SaveAs Filename:=SAVEDBF, FileFormat:=xlDBF4
xlBook.Close savechanges:=False 

xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing 

End Sub

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

See more here:
Access exports long integer numbers as double data type with decimal places in dBase IV (.dbf) format

Page 330 of 516« First...102030...328329330331332...340350360...Last »

Recent Comments

    Archives

    Categories