jet

Reset autonumber seed

狂风中的少年 提交于 2019-11-29 10:28:24
I have a VB6/Access application that occasionally encounters a problem with wrong autonumber field seed. Lets say there is a table MYTABLE with an autonumber field ID (that is also the primary key). Lets say at the moment the maximum value of ID is 1000. When the application inserts a new record (ID value is not provided explicitly), for some reason it decides that the next autonumber field value is 950 (and not 1001 as it should be) - so a primary key violation error occurs. I found a KB article that describes my symptoms: http://support.microsoft.com/kb/884185 . In short, they suggest to run

Problem with using OleDbDataAdapter to fetch data from a Excel sheet

北战南征 提交于 2019-11-29 07:19:46
First, I want to say that I'm out on deep water here, since I'm just doing some changes to code that is written by someone else in the company, using OleDbDataAdapter to "talk" to Excel and I'm not familiar with that. There is one bug there I just can't follow. I'm trying to use a OleDbDataAdapter to read in a excel file with around 450 lines. In the code it's done like this: connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source='" + path + "';" + "Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1;\""); connection.Open(); OleDbDataAdapter objAdapter = new

How can I get a list of tables in an Access (Jet) database?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 03:55:47
I need to see if a table exists in an Access database used by my c# program. Is know there are SQL commands for other databases that will return a list of tables. Is there such a command for Access/Jet databases? Try the GetSchema() connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\access.mdb"; connection.Open(); DataTable userTables = connection.GetSchema("Tables"); Full code : Get List of Tables in an Access Database - ADO.NET Tutorials // Microsoft Access provider factory DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); DataTable

Maximum number of rows in an MS Access database engine table?

大城市里の小女人 提交于 2019-11-28 11:59:29
We know the MS Access database engine is 'throttled' to allow a maximum file size of 2GB (or perhaps internally wired to be limited to fewer than some power of 2 of 4KB data pages). But what does this mean in practical terms? To help me measure this, can you tell me the maximum number of rows that can be inserted into a MS Access database engine table? To satisfy the definition of a table, all rows must be unique, therefore a unique constraint (e.g. PRIMARY KEY , UNIQUE , CHECK , Data Macro, etc) is a requirement. EDIT: I realize there is a theoretical limit but what I am interested in is the

Does ACEDAO support row level locking?

冷暖自知 提交于 2019-11-28 09:09:04
问题 There was a problem with DAO 3.6 in that it didn't support row-level locking. For details, see this Knowledge Base article. I learned from the Access team's blog: In Office Access 2007, new objects, properties, and methods will be added to DAO to support the new features in the Access database engine. From looking at this library in the Access2007 Visual Basic Editor's Object Browser that the new incarnation is called ACEDAO. I can find mention of acedao.dll in hotfixes on MSDN but nothing

Problem with using OleDbDataAdapter to fetch data from a Excel sheet

拥有回忆 提交于 2019-11-28 00:45:13
问题 First, I want to say that I'm out on deep water here, since I'm just doing some changes to code that is written by someone else in the company, using OleDbDataAdapter to "talk" to Excel and I'm not familiar with that. There is one bug there I just can't follow. I'm trying to use a OleDbDataAdapter to read in a excel file with around 450 lines. In the code it's done like this: connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source='" + path + "';" + "Extended

How can I get a list of tables in an Access (Jet) database?

爱⌒轻易说出口 提交于 2019-11-27 17:52:28
问题 I need to see if a table exists in an Access database used by my c# program. Is know there are SQL commands for other databases that will return a list of tables. Is there such a command for Access/Jet databases? 回答1: Try the GetSchema() connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\access.mdb"; connection.Open(); DataTable userTables = connection.GetSchema("Tables"); 回答2: Full code : Get List of Tables in an Access Database - ADO.NET Tutorials // Microsoft

I need a workaround for Excel Guessing Data Types problem

蓝咒 提交于 2019-11-27 14:51:12
I'm creating a utility to import data from Excel to Oracle database, I have a fixed template for the excel file, Now, when I'm trying to import the data by Jet provider and ADO.Net - Ole connection tools, I found the following problem: there're some columns haven't been imported because there are mixed data types in their columns [string and number], I looked for this problem on the internet I found the reason is guessing data types from Excel The load code: connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0};Extended Properties=Excel 8.0;"); string columns =

The Microsoft ACE driver changes the floating point precision in the rest of my program

大城市里の小女人 提交于 2019-11-27 09:31:57
I am having a problem where it seems that the results of some calculations change after having used the Microsoft ACE driver to open an Excel spreadsheet. The code belows reproduces the problem. The first two calls to DoCalculation yield the same results. Then I call the function OpenSpreadSheet which opens and closes an Excel 2003 spreadsheet using the ACE driver. You would not expect OpenSpreadSheet to have any effect on the last call to DoCalculation but it turns out that the result actually changes. This is the output that the program generates: 1,59142713593566 1,59142713593566 1

Exporting MS Access Forms and Class / Modules Recursively to text files?

我怕爱的太早我们不能终老 提交于 2019-11-27 07:18:40
I found some code on an ancient message board that nicely exports all of the VBA code from classes, modules and forms (see below): Option Explicit Option Compare Database Function SaveToFile() 'Save the code for all modules to files in currentDatabaseDir\Code Dim Name As String Dim WasOpen As Boolean Dim Last As Integer Dim I As Integer Dim TopDir As String, Path As String, FileName As String Dim F As Long 'File for saving code Dim LineCount As Long 'Line count of current module I = InStrRev(CurrentDb.Name, "\") TopDir = VBA.Left(CurrentDb.Name, I - 1) Path = TopDir & "\" & "Code" 'Path where