ado

ADO: Excel: Is it possible to open recordset on table name?

a 夏天 提交于 2020-03-21 06:22:51
问题 I have looked on the web but did not find any answer. So i am putting it here. Code snippet: ( where case 1 is not working.. ) _bstr_t strCnn(L"Provider='Microsoft.ACE.OLEDB.12.0';DataSource=C:\\Book.xlsx;Extended Properties=\"Excel 12.0 Xml; HDR = YES\""); hr = pConn->Open(strCnn, "", "", adConnectUnspecified); // success **LPCSTR strQuery = "select * FROM Table1"; // case1: Not working** LPCSTR strQuery = "select * FROM [Sheet1$]"; // case2: working LPCSTR strQuery = "select * FROM [Sheet1

Open/Close ADO Connection

旧时模样 提交于 2020-01-25 01:01:10
问题 I am trying to import data from Access to Excel. There are four columns in the Access table: Date, Time, Tank, Comments. On importing the Time and Tank columns, I sort them based on date. Additionally, I import them separately so I can swap the column order form Time, Tank to Tank, Time. In the programming I have to close and open the ADO connection for that. I want to make the program more efficient by avoiding closing the connection and having to open it again. Any suggestions/solutions?

Indexed MySQL field not saving value when creating/editing record through ADO

与世无争的帅哥 提交于 2020-01-24 07:44:27
问题 I am using ADO to add a record to a MySQL table. The code works fine, and the data is posted to the new record, all except the userid . I can't figure out why. '--------------------------------------------------------------------------------------- ' Procedure : IPhpList_AddHistory ' Author : Adam ' Date : 12/8/2014 ' Purpose : Add a history record to the phpList account. '--------------------------------------------------------------------------------------- ' Private Sub IPhpList_AddHistory

Indexed MySQL field not saving value when creating/editing record through ADO

狂风中的少年 提交于 2020-01-24 07:44:05
问题 I am using ADO to add a record to a MySQL table. The code works fine, and the data is posted to the new record, all except the userid . I can't figure out why. '--------------------------------------------------------------------------------------- ' Procedure : IPhpList_AddHistory ' Author : Adam ' Date : 12/8/2014 ' Purpose : Add a history record to the phpList account. '--------------------------------------------------------------------------------------- ' Private Sub IPhpList_AddHistory

Using ADODataset component to open an Excel Spreadsheet

一个人想着一个人 提交于 2020-01-24 06:24:38
问题 I'm using ADOdataset component to view an Excel Spreadsheet on a Delphi form. The component requires that the CommandText property be set to the name of a spreadsheet in the workbook being opened. How can I set this property to open the first spreadsheet in the workbook regardless of the name? procedure TForm1.BitBtn1Click(Sender: TObject); var XLSFile, CStr : string; begin if OpenDialog1.Execute() then begin XLSFile := OpenDialog1.FileName; CStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data

Strange ADO behavior generating unwanted NO_BROWSETABLE / set fmtonly queries in VB6

最后都变了- 提交于 2020-01-17 04:15:29
问题 I am strugling with some unwanted metadata requests automatically generated by ADO. The behavior started after replacing the default MSDASQL provider with SQLOLEDB. I have also tried the SQLOLEDB and the behavior seems to be the same. Reproducing the problem from the IDE has proved to be difficult, because it seems to be happening kinda random. Whats even more confising is that these queries seems to request metadata for previously opened (and then closed) recordsets. 回答1: I have invastigated

Excel VBA ADO UPDATE SQL Table/Record

泪湿孤枕 提交于 2020-01-17 04:13:53
问题 I have managed to update an SQL table and record by using this SQL string "UPDATE Breach_Test_Key SET [VAL_BREACH_REASON] = 'SOME BREACH REASON' WHERE [ID] = 1" Two things I am trying to achieve and that is: Update two specific columns in the SQL Table, how do I define two columns in the SET? I also need to update all records that are in a table in Excel back into an SQL table (which will all exist in the SQL table). The ID field will always match as the data is from this table. Please could

Multiple-step OLE DB operation generated errors

跟風遠走 提交于 2020-01-17 03:48:05
问题 Dim NorthWindOledbConnection As String = "Provider=SQLOLEDB;DataSOurce=SARAN-PC\SQLEXPRESS;Integrated Security=ssp1;InitialCatalog=Sara" Dim rs As New ADODB.Recordset() rs.Open("select * from SecUserPassword", NorthWindOledbConnection, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockBatchOptimistic) i tried to run this above code in visual studio 2008 - it shows the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No

How can I fix ORA: 01013 (user requested cancel…) when trying to link Oracle tables in MS Access?

 ̄綄美尐妖づ 提交于 2020-01-16 18:11:42
问题 I have installed Oracle Express (XE, version 18) on a Windows 10 (64-bit) machine with Office 365 (32-bit) installed. I have installed the correct Oracle Instant Client (18_3) and its ODBC package (32-bit versions). I successfully created a DSN using the ODBC Data Source Administrator (32-bit) tool in windows. When I attempt to link tables into an Access database, I get error ORA: 01013. If I remove the timeout from the DSN configuration, it simply spins with the Oracle RDBMS kernel eating up

I have a syntax error in my insert into statement

一曲冷凌霜 提交于 2020-01-16 04:28:25
问题 I'm using a MS Access database, with the following columns in the Admins table: Column Type ====== ==== Name Text Surname Text Dateadded Date/time Adminnumber Number(long integer) Password Text ID type Autonumber (Not sure if ID is relevant) This is my code but it keeps giving me a syntax error. ADOquery1.Active := false; adoquery1.sql.Text := 'insert into Admins(Name, surname, Adminnumber, Dateadded,password)Values('''+edit11.Text+''', '''+edit12.text+''', '''+edit13.Text+''', '''+edit14