recordset

Error 3061 Query “loses” form text value

拥有回忆 提交于 2019-12-11 10:05:14
问题 I looked at a number of 3061 posts but they all have the query in VB. I am trying to run an already saved query in Access, that has a filter using a text field on a form. So all I am trying to do is just get a recordset from an existing query. Not sure quite how to explain what's going on. But I have a Master form which holds the current selected date in a text object. I have a query that filters results based on the text object value: SELECT DISTINCT EmployeeName FROM dbo_Audits WHERE dbo

ADODB RecordSet to string variable VBA

非 Y 不嫁゛ 提交于 2019-12-11 10:00:23
问题 Quick question about ADODB recordset. I want to extract a query result from a recordset and set it to a string variable: query = "SELECT Value1 FROM Table" RS = New ADODB.Recordset RS.Open(query,Conn) The query is always going to return 3 values. I want take to assign these three values to a variable. RS.GetString returns the query results tab delimited, but I want to be able to iterate through this set and assign each row result to its own variable. Any ideas? Thanks in advance! 回答1: You can

How to write an ADODB.RecordSet (made from an Excel Range) to a SQL Server temporary table

人走茶凉 提交于 2019-12-11 07:56:54
问题 Using VBA Excel I generate various ADODB.RecordSet objects. I would like to harness the power of temp table generation in SQL Server, e.g. select * into #temp1 from Test1 --create temporary table on the fly In particular, I'm interested in the automatic column generation, and would like to have have the ability to transfor my RecordSet objects into temporary tables in SQL Server. 来源: https://stackoverflow.com/questions/25867442/how-to-write-an-adodb-recordset-made-from-an-excel-range-to-a-sql

Programmatically changing the RecordsetType in ms access or a better method

半腔热情 提交于 2019-12-11 07:38:58
问题 In ms access I have a form which also has a sub-form. I wanted to programmatically change the RecordsetType in the main-form to snapshot when the sub-table/sub-form has associated records in the one-to-many relationship. I wrote some vba code to do this but I was experiencing some very odd behaviour. I then discovered that it was because when I change the RecordsetType, the form refreshes and navigates back to the first record. That then causes the On Current event and associated code to fire

How can I correct this ADODB missing reference error in VB .NET that I'm getting after upgrading to Windows 10?

别说谁变了你拦得住时间么 提交于 2019-12-11 04:19:17
问题 After upgrading to Windows 10, I got a lot of errors relating to a broken ADODB reference in my VB .NET application. I performed the steps described in the answer from this topic and that seemed to fix the broken reference errors. That solution actually got the application working for some of my colleagues on their Windows 10 systems. Unfortunately, anywhere in the application where I'm using a Recordset, I'm still getting this error: "Reference required to assembly 'ADODB, Version=2.5.0.0,

Displaying a recordset on a form in Access 2010 using VBA

匆匆过客 提交于 2019-12-11 01:54:43
问题 I'm developing a data retrieval application in Access 2010 in which the user chooses which table, columns, and rows to view by selecting listbox entries. The VBA code generates a SQL statement from these choices and then creates an ADBDB.Recordset object from this. How can I display the recordset records in Access? None of the grid controls work in Access 2010 and the subform just isn't designed for this purpose. Can someone recommend another strategy? 回答1: You could save the SELECT statement

Use text from record to paste into an Access form controlbox

南笙酒味 提交于 2019-12-11 00:19:09
问题 Based on a user's job ID number, I create a recordset of an ID with its different unit types (think pipe sizes) and unit (think footage of pipe). Each unit type record already has the name of the form textbox where the total footage goes in a different column. What I want to do is go through each recordset and plugin the footage for each unit type for that job ID number (that the user puts in a form). Dim rst_UnitEntryCounts As Recordset Set rst_UnitEntryCounts = CurrentDb.OpenRecordset(

How to read recordset as string in VBA

谁都会走 提交于 2019-12-10 15:59:27
问题 I have some code to read records from a database. when i read , the recordset variable modifies the table value to its own format. For Eg: In Database Time value is 12345 (Not date & time) but when record set reads it, it comes as For Eg: 23-06-2012 10:15:23 I just found that the recordset itself stores values in its own format after doing. Set rs = CmdSqlData.Execute() So is there any way to define a recordset as String ? Here is the code. Dim rs As ADODB.RecordSet Set rs = CmdSqlData

Performance of passing data between .Net and COM assemblies

喜欢而已 提交于 2019-12-10 10:18:09
问题 I am in the process of migrating a legacy VB6 app to .Net, however since it is a high-profile business critical application, it is being done piece by piece. In the interest of improving performance, there is one method which gets hit a lot,thousands of times during the application life, and I was wanting to rewrite it in .Net (C#) to see if the runtime can be improved. The method in question manipulates ADODB Recordsets. Is there any performance issues I should be aware of or take into

How to populate a ComboBox with a Recordset using VBA

跟風遠走 提交于 2019-12-09 10:03:15
问题 There is some literature available at expert's exchange and at teck republic about using the combobox.recordset property to populate a combobox in an Access form. These controls are usually populated with a "SELECT *" string in the 'rowsource' properties of the control, referencing a table or query available on the client's side of the app. When I need to display server's side data in a combobox, I create a temporary local table and import requested records. This is time consuming, specially