oledb

Reading DBF with VFPOLEDB driver

与世无争的帅哥 提交于 2019-12-01 17:38:06
I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value. Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView. public DataSet GetDBFData(FileInfo fi, string tbl) { using (OleDbConnection conn = new OleDbConnection( @"Provider=VFPOLEDB.1;Data Source=" + fi.DirectoryName + "

How to count empty rows when reading from Excel

时光总嘲笑我的痴心妄想 提交于 2019-12-01 17:36:08
问题 I'm using OLEDB to connect and read through data from an Excel spreadsheet. I have IMEX="1" and everything works ok. My problem is the sheets I'm reading from may start with several empty rows and the number of empty rows is important. For example, if I was reading a 5x5 grid like: - - - - - - - - - - 2 - 3 3 8 - - - - - - - 5 2 2 where '-' represents an empty cell. The fact that the first two rows are empty is important. The size of the grid is dynamic. My code appears to be ignoring the

Reading DBF with VFPOLEDB driver

只谈情不闲聊 提交于 2019-12-01 16:41:37
问题 I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value. Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView. public DataSet GetDBFData(FileInfo fi, string tbl) { using

Requested operation requires an OLE DB Session object… - Connecting Excel to SQL server via ADO

那年仲夏 提交于 2019-12-01 16:28:32
I'm attempting to take Excel 2003 and connect it to SQL Server 2000 to run a few dynamicly generated SQL Queries which ultimately filling certain cells. I'm attempting to do this via VBA via ADO (I've tried 2.8 to 2.0) but I'm getting an error while setting the ActiveConnection variable which is inside the ADODB.Connection object. I need to resolve this pretty quick... Requested operation requires an OLE DB Session object, which is not supported by the current provider. I'm honestly not sure what this error means and right now I don't care. How can get this connection to succeed so that I can

C# Excel doesn't close itself when using OleDbConnection's Open method

房东的猫 提交于 2019-12-01 13:28:17
I am creating and releasing references to excel com interfaces to manipulate excel's worksheets. In this situation Excel closes itself correctly. If I use OleDbDataAdapter connection to fetch data then excel is still in the memory. I have read almost everything on this subject. I have created subroutines to appropriate release references. I am using: GC.Collect(); GC.WaitForPendingFinalizers(); What else can I do? This seems to be obscure problem.. Here is the code: namespace ExcelTestCode { class Program { static void Main(string[] args) { Application excel = null; Workbook workbook = null;

Detect time of last change on a Microsoft Access database table

夙愿已清 提交于 2019-12-01 12:16:24
问题 Does anyone know of a way to detect when the last time a Microsoft Access table has been changed (inserted into or updated)? We used OLEDB via ADO COM to communicate with an access database programmatically and were looking for a way of detecting changes to specific tables. We don't need to know what those changes are, just that changes were made. 回答1: The only way to detect if data in the table has changed is to perform a query against the table. You must add a column of type DATETIME to the

C# AND ACCESS - Data type mismatch in criteria expression

早过忘川 提交于 2019-12-01 11:55:30
I've created a code that updates/edits details of a/an computer/electronic product for a C# program connecting to the MS Access. Here are the codes: OleDbCommand cmd = new OleDbCommand("UPDATE Available SET ProductType = '" + newAvailable.ProductType + "', Brand = '"+ newAvailable.Brand + "', Model = '" + newAvailable.Model + "', SerialNo = '" + newAvailable.SerialNo + "', Remarks = '" + newAvailable.Remarks + "', RAM = '" + newAvailable.RAM + "', HDD = '" + newAvailable.HDD + "', ODD = '" + newAvailable.ODD + "', VideoCard = '" + newAvailable.VideoCard + "', PS = '" + newAvailable.PS + "'

OLEDB query on Excel without headers: How do I specify Columns?

你。 提交于 2019-12-01 11:30:37
问题 I need to be able to handle Excel files versions 97 - 2010 and also those with and without header info. Don't need help with connection strings : that works. What I do need help with is querying worksheets that do not have header information i.e. no descriptor of a column's data in the first row. How do I refer to these columns in the OLEDB query? I've tried the following "Select [Sheet2$A] from [Sheet2$]" //selecting Column A "Select [Sheet2$A$] from [Sheet2$]" //selecting Column A 回答1:

Oppposite Workings of OLEDB/ODBC between Python and MS Access VBA

会有一股神秘感。 提交于 2019-12-01 11:28:39
Fellow more advanced programmers: Please forgive me if this seems like the tired Python 32-bit/64-bit ODBC/OLEDB Windows issue but I tried searching the forums and can't quite find the reason to my issue. Basically, I tried to connect a very simple Python script first via ODBC using the pypyodbc module, and then second via OLEDB using the adodbapi module, both attempts to an MS Access 2010 .accdb database. However, for OLEDB I consistently get the 'Provider not found. It may not be properly installed' error. And for ODBC I consistently receive the 'Data source name not found and no default

C# Excel doesn't close itself when using OleDbConnection's Open method

拟墨画扇 提交于 2019-12-01 10:57:11
问题 I am creating and releasing references to excel com interfaces to manipulate excel's worksheets. In this situation Excel closes itself correctly. If I use OleDbDataAdapter connection to fetch data then excel is still in the memory. I have read almost everything on this subject. I have created subroutines to appropriate release references. I am using: GC.Collect(); GC.WaitForPendingFinalizers(); What else can I do? This seems to be obscure problem.. Here is the code: namespace ExcelTestCode {