ado recordset

  1. vds1

    SQL query works in MS Access but doesnt when called from excel VBA

    Hi Gurus - Thank you for looking into my problem. Below query works when i execute in MS Access. Its a standard query which i plan to call in Excel using ADO. select * from qryForwardRecon; When the above query is called using ADO in Excel VBA , i get zero records. Not sure what could be...
  2. S

    Trying to get the Identity right after .Update using SQLOLEDB

    I'm just wondering if anyone knows why I have to execute the query twice in the code below to get the Identity? Example: Set rs = Cn.Execute("SELECT @@Identity as NewID", , adCmdText) x = rs.Fields("NewID").Value '''returns null Set rs = Cn.Execute("SELECT @@Identity as...
  3. M

    Read text file using ADO and populate a... Listbox in this example

    The below sub i created to populate a listbox using ADO to read a text file as Access and SQL were unavailable. I needed 2 columns from the txt file and one would differ per user so i used the persons computer username as the column name i would need (so it would work for anybody in the table)...
  4. bfreescott

    ADO queries are throwing errors that files are already open.

    I have an ADO query that pulls data from other excel files (without opening them - thus, the reason for choosing ADO to begin with), but the queries are erroring out when the file being queried is already opened by another user. Have you seen this or been able to resolve it?
  5. M

    ADO SQL and Recordset HELP!!

    Hello All, I am having the most wretched time trying to figure this out. I have a worksheet with merged cells (I cant change the input format, I know, I know merged cells are evil and very true for me right now). But anyway in order to get the data I need I have to run 2 queries which works...
  6. D

    Excel/ADO: Sometimes no records found

    I can usually run the following code without issue, but it sometimes fails to find any records in the record set. The file itself is large - over 200k rows. In addition, it has some merged cells, and the column widths are not wide enough to view the data without auto-fitting (I am not sure...
  7. G

    ADO connection, Execute method, and Excel VBA...

    Dear friends, I'm creating an Excel Add-in that has several functions. Also I have a bid data in Access (more than 10 000 rows, and several tables). The Add-in connects to DB when it opens. Then every function in the Add-in use RecordSets to read data from Access DB and do some calculations...
  8. S

    Need to paste result output of two queries with both headers in same page!!

    Hello All I need to paste the output of two queries in same worksheet. When my code is executed it pastes the header and values of first query. But for the second query i get only values and not header.. Please help me.. Below is my code.. Private Sub CommandButton1_Click() Label5 = " "...
  9. B

    All about those recordset objects

    I'm trying to do the following Send a query to a SQL Server DB Receive a dataset (in the form of a recordset object) Store all of the rows of a specific column of the recordset data into a dynamic array (which would require something like redim array(1 to recordset.recordcount). I can use the...
  10. M

    Using ADO to Save, Recall and Update records in Access using Excel 2003

    I'm not too familiar with Access and linking to it from Excel so thought that on a recent project I would try and build up my skill set and use ADO, plus the use of a database in this instance was appropriate. So far, I have figured out how to Recall a record that matches a certain condition...
  11. M

    ADODB SQL Statement ORDER BY Statement

    Hi, I have been reading a lot about ADODB but I couldn't figure my problem. I hope someone here can help. I have an Excel Sheet which I use as Database. The database has 11 columns and I insert data with the following function: Sub testInsert() Dim adoCommand As New ADODB.Command Dim...
  12. P

    cannot do rs.AddNew after setting rs=cn.Execute(strsql)

    I have opened my recordset rs with adLockOptimistic which set LockType to 3. However after I Set rs = cn.Execute(strSQL) which executes my SQL string, the LockType got reset to 1, which is read-only and I cannot do an rs.AddNew to the recordset. Code: <tbody> Set rs =...

Some videos you may like

This Week's Hot Topics