adodb

return database message on successful sql execution using VBScript

元气小坏坏 提交于 2019-12-13 03:07:08
问题 I need to capture sql message upon successful execution of sql statement using vbscript. Here is my code. Public Function ExecuteAPI_String(sql_Statement) Dim num On Error Resume Next Set objRecordSet = objConnection.Execute sql_Statement,num,adExecuteNoRecords If Err.Number <> 0 Then ExecuteSQLStatement_String = Err.description objRecordSet.Close Err.Clear Else ExecuteAPI_String = num & "records were affected" objRecordSet.Close End If 回答1: The problem here is the use of On Error Resume Next

Getting wrong value for variant_date_to_timestamp() function

為{幸葍}努か 提交于 2019-12-13 01:20:30
问题 In relation with this question, I'm getting a wrong value for the the modified date when querying the windows ADODB connection for indexing files. This is the line or the query: $recordset - > Open("SELECT System.ItemName, System.DateModified FROM SYSTEMINDEX WHERE DIRECTORY='file:C:/xxxx/' AND CONTAINS('xxxx')", $conn); I've getting good results on localhost (php 5.5.6), but not in other servers (php 5.5.8). I'm getting the wrong timestamp value and therefore it converts it into a wrong date

Output parameter of MySQL stored procedures via ADODB in MS Access (VBA) correct on one computer and random on another

有些话、适合烂在心里 提交于 2019-12-12 18:25:57
问题 I have tried (nearly) everything to isolate the problem, but I am lost. I have an MS Access application that uses ADODB to interface to a local MySQL database. I copied it to a new computer, but now the output parameters of the stored procedures contain a random value each time (if done via ADODB). When executed in MySQL WorkBench, the output parameters are correct. Here are the specs of the 2 computers: old : Windows 7 Pro, Office 2010 ProPlus, MySQL ODBC 5.3.4, MySQL server 5.6.22 (all are

Strange error appending fields to recordset in VS2010 after converting to .NET 4

爷,独闯天下 提交于 2019-12-12 16:00:34
问题 I have some code from this site CodeProjectLink to convert a datatable to a recordset. This code had been working fine until I changed to .NET 4 (was previously 2), now when I call the following line: Dim result As New ADODB.Recordset() result.CursorLocation = ADODB.CursorLocationEnum.adUseClient Dim resultFields As ADODB.Fields = result.Fields Dim inColumns As System.Data.DataColumnCollection = inTable.Columns For Each inColumn As DataColumn In inColumns ' The next line gives the error

ADODB wait for query to complete before refreshing a different connection

时光怂恿深爱的人放手 提交于 2019-12-12 11:19:07
问题 I have a table in excel that is populated through a connection to an Access database. I am trying to write a macro that allows you to delete individual rows from this table. I use an ADODB connection to pass the delete command to Access, which works fine. However, at the end of the macro I want to refresh the table in excel so that, upon completion of the macro, the deleted record will no longer appear in that table. I have already set backgroundquery = False on the connection that populates

ADODB RecordSet as Access Report RecordSource

烈酒焚心 提交于 2019-12-12 08:48:02
问题 I have a simple form, a query and a report in Access 2003. I have to manipulate the results from the query in a recordset using VBA and then pass it on to the report as its RecordSource. If I declare the recordset as RecordSet and use its Name property as the RecordSource of the report then it is working. However, because I need to edit the recordset, I though it would be easier to use an ADODB RecordSet as below. The records set is declared as Dim rs As ADODB.RecordSet in a global module.

ADODB supported by Visual Studio 2010?

一世执手 提交于 2019-12-12 05:47:50
问题 i wan to use ADODB components in my project, but i cant find adodb component in Visual Studio 2010, it supported by Visual Studio 2010?? 回答1: ADODB is wrapped by the classes in the System.Data.Oledb namespace. If you are talking about the old VB6 components that you could put on a form then, no, their time has passed. They are visible in the toolbox' Choose Items dialog, COM tab. But trying to add them fails on my machine. Probably because ADODB got a breaking update in Windows 7 SP1. Nor

data entry forms show #error in most columns of a previous record

£可爱£侵袭症+ 提交于 2019-12-12 05:16:06
问题 I have a 2010 MS Access Application that ran fine until importing into MS Access 2013. Now all the data entry forms show #Error in most columns of a previous record when inserting a new record. The Forms use ADODB.Recordsets. The #Error persists until clicking on each field where it reverts to original data. Before Vendor Update of a New Record RowID Vendor Ticket 1 DUFFERIN 12345 2 LAFARGE 54321 3 MILTON After Vendor Update RowID Vendor Ticket 1 DUFFERIN 12345 3 #ERROR #ERROR 3 MILTON 123 My

Using ADODB in VBScript to find the number of rows in an Excel sheet?

混江龙づ霸主 提交于 2019-12-12 04:38:55
问题 I'm trying to use ADODB in VBScript to access an Excel file to find the number of rows in a given sheet that have data entered into them. My code so far displays everything on the sheet, but I'm not sure how I could count the rows or directly find the number of rows using a query. I want to use ADODB as it doesn't open the Excel file directly, but if this isn't the best way then how could I do it otherwise? Thanks. Set adodb = CreateObject("ADODB.Connection") adodb.Open "Provider=Microsoft

SCOPE_IDENTITY() vs. rs.Fields

人走茶凉 提交于 2019-12-12 04:03:52
问题 what is the difference in the way these work: Sql = "INSERT INTO mytable (datapath, analysistime,reporttime, lastcalib,analystname,reportname,batchstate,instrument) " & _ "VALUES (dpath, atime, rtime,lcalib,aname,rname,bstate,instrument) SELECT SCOPE_IDENTITY()" Set rs = cn.Execute Set rs = rs.NextRecordset and this: With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields("analysistime") = atime .Fields("reporttime") = rtime .Fields(