oledb

C# Access Database In use or Permission Failure

為{幸葍}努か 提交于 2019-12-24 22:25:21
问题 I'm using Access 2007 and C# to learn Databases. So far it's been rough but I've been able to handle things relatively well. What I need to do though is to query a my database table Accounts for the Amount of money a user has based on their pin. I've placed a button on the Windows Form I am using that will query the database on click. When I run/click the button as per normal I recieve the following error. Essentially my question is this: How would I go about setting the permissions up so

Excel does not have updated values using oledb c#

无人久伴 提交于 2019-12-24 20:22:42
问题 I am new to C# and trying to write values to an excel file using OLEDB. The problem here is the first time if there is no excel file present in that location it works fine and prints the value to excel, but the second time if the excel is present it does not overwrite or write a new value to the excel. I also need to run this in a loop as I have four rows to print and not one. Need help with this. This is my code snippet and I know I it has code for only one row to print but I don't know the

query (join) external wokbooks from a macro

戏子无情 提交于 2019-12-24 17:12:14
问题 I got 3 Excel workbooks: the macro (will be an add-in when finished) the previous period data list the current period data list Both lists are less than 1000 rows. I am trying to make an SQL join between those lists but I can't get it working. Since the sheets names have dots in them (like "TB 03.18"), I used the trick -found somewhere on SO- to define named ranges in the respective workbooks. Below is the code with the information of the 2 SQL that work and the one that gives an error. I am

SQL query returning 'Overload resolution error'

£可爱£侵袭症+ 提交于 2019-12-24 16:53:34
问题 I have a readini file to connect to my SQL Server table, and in my query code to display data from it, I'm getting an error that I've not been able to solve, is there anybody here who can? This is the error: Error 1 Overload resolution failed because no accessible 'New' can be called with these arguments: 'Public Sub New(selectCommandText As String, selectConnection As System.Data.OleDb.OleDbConnection)': Value of type 'SQLServerApplication.readini' cannot be converted to 'System.Data.OleDb

Syntax Error on a Sql Parametrized update command - c#

倖福魔咒の 提交于 2019-12-24 16:22:49
问题 It's my first SQL Parametrized update command in c# and i have a syntax error when i exectued my update. Here is my code : string maRequete = "UPDATE " + strNomTable + " set " + "evetype = @evetype ," + "evedes = @evedes ," + "evecli = @evecli ," + "eveusermo = @eveusermo ," + "eveinterv = @eveinterv where eveNum = " + '"' + strEvtNumeroString.ToString() + '"'; OleDbCommand DbCommand = new OleDbCommand(maRequete); DbCommand.Parameters.Add("@evetype", OleDbType.VarChar); DbCommand.Parameters

Copy table from one database to another in Windows Forms using C# and MS Access Oledb

余生长醉 提交于 2019-12-24 16:19:49
问题 How to copy a table from one database to another , I'm developing a windows app using c# in .NET.The copying has to be done by the app. Extract data into an empty table in database 2 from a filled table in database1.I'm using access db , Oledbconnection. I found some answers for sql server though , but not really helping. 回答1: You can refer to the second DB in SQL and execute against a connection to the first mdb/accdb: Connection using System.Data.OleDb; <...> string ConnString = @"Provider

Reading tables using OleDBConnection

非 Y 不嫁゛ 提交于 2019-12-24 16:14:21
问题 First off, i'm new to VB and this is my first project using OleDBConnection. ok, so i'm trying to the most simple thing using oleDbConnection (i assume). I just want to read data from a table in the Access DB and display that information to dropboxes (or anything) in my winForm. Public Class QueManger Dim dbConnection As OleDbConnection Dim dbCommand As OleDbCommand Dim dbDataAdapter As OleDbDataAdapter Dim ConnectString As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & "Data Source = \

The Microsoft jet database engine could not find object while reading dbf file

北城以北 提交于 2019-12-24 15:51:48
问题 I am facing very strange issue. I have written class to which reads dbf file through oledb connection. I have downloaded dbf file from internet and it is reading all data correctly. DBF file location: E:\Projects\SLAVE.DBF I am facing following 2 issues 1) When I try to read other dbf file then it is reading only its table fields. it is not reading table fields data. E:\Projects\line75.dbf 2) The other issue I am facing I have DBF files when I put these files in location then i am getting

SQL Command text with parameter OLEDB Source

不羁岁月 提交于 2019-12-24 15:27:20
问题 I am working with SQL Server Integration Services 2008. In my Data Flow task I got a OLEDB source. I choose SQL command as the Data Access mode and following is my sql text Select * from table1 where ID=? And from parameters tab my Parameter Name is zero "0" and value is coming from a package level variable. I tried to replace the parameter name with "Parameter0" but I always get the same error that Error: "No Value given for one or more required parameters" But there is a value for my

How to pass a named parameter to an Visual FoxPro OLE DB Command?

泄露秘密 提交于 2019-12-24 13:41:29
问题 I recently accessed some DBF in VS.NET, using Visual FoxPro OLE DB Provider. Everything worked fine until I found that I could not figure out how to pass a parameter to the query. I used this as query Select `group`, `i_name`, `j_name`, ... From `mytable` Where `valid` AND `group` IN (@`group1`, @`group2`); And added two parameters named group1 and group2 , with string values, to the parameter collection (ie. IDbCommand.Parameters ). Then I received an OleDbException, telling me Syntax error.