adodb

VBScript to correctly/re format a delimited text file?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 11:53:03
问题 Can someone help me reformat/correctly format a delimited text file using VBScript? I have a text file that is ^ delimited as below: AGREE^NAME^ADD1^ADD2^ADD3^ADD4^PCODE^BAL^ARREARS 00010004000051162^MISS JENNIFER GRAY ^123 FAKE STREET ^ ^TOWN ^COUNTY ^POSTCODE ^ 004978.00^ 000188.72 All of the data contains leading and trailing spaces that need to be removed. I only have VBScript available to do this. I have tried to use ADO GetStrings but it has yielded inconsistent results because of the

ADODB COM object not found

时光毁灭记忆、已成空白 提交于 2019-12-06 05:06:17
I am using ADODB COM object in my c# application which is developed on Windows 2008 R2 Standard 64bit. Now I have moved application on prod server with Windows 2008 Standard 64bit(not R2) and now I get error below. It seems MDAC 2.8 is not installed on my prod machine? I can't find any reference how to install MDAC 2.8 on Windows 2008 machine, maybe someone could point me to right direction? Error: Unable to cast COM object of type 'ADODB.StreamClass' to interface type 'ADODB._Stream'. This operation failed because the QueryInterface call on the COM component for the interface with IID '

ADO Command running multiple SQL statements: can't get error message back: USE THE Connection.Errors collection

戏子无情 提交于 2019-12-06 04:51:49
问题 I have some triggers on various tables that use raiserror to tell the user that he tried to do something bad. I would like to run several inserts and updates atomically, rolling back if one of the triggers says so. I was evil in a former life so I'm using Access VBA. If the first statement is at fault, I get a run time error in my VBA. However if the second or subsequent statement calls raiserror then I can't see any error message. SOLUTION: examine the connection.Errors collection. This is

Class: ADORecordSet_mysql Easy way to get an Array indexed by id of row

荒凉一梦 提交于 2019-12-06 02:42:04
I have a table with a primary key called 'id' and I am using ADODB and getting a ADORecordSet_mysql back. I need an array where the id is associated with a row in the result set, but ADODBRecordSet_mysql only seems to have a GetArray(int startingRow) method that returns an array indexed by startingRow (where the default is 0). I don't want to have to iterate through this result set an associate the id's to each row myself and I don't like the idea of having to pass into GetArray a starting index. I would rather be able to get the array back with it indexed using my primary key. Is this

ADODB component causes access violation on Win7/Server 2008

﹥>﹥吖頭↗ 提交于 2019-12-06 02:30:07
I have a piece of code written in Delphi 2005 that searches for a particular attribute on a user in LDAP. I get an access violation when this is run on either Windows 7 or Server 2008, but not on XP or 2003. Function IsSSOUser(UserId: String): Boolean; var S : string; ADOQuery : TADOQuery; ADOConnectionSSO: TADOConnection; begin result := false; Setdomainname; ADOQuery := TADOQuery.Create(nil); ADOConnectionSSO := TADOConnection.Create(nil); try ADOConnectionSSO.LoginPrompt := false; ADOConnectionSSO.Mode := cmRead; ADOConnectionSSO.Provider := 'ADsDSOObject'; ADOQuery.Connection :=

Access form linked to disconnected ADODB.Recordset: save changes

∥☆過路亽.° 提交于 2019-12-05 18:22:47
I am trying to set up a form to use a disconnected ADODB.Recordset as its source. The issue I have is that changes are not saved into the original Access table upon closing the form and replying "Yes" to the prompt. What am I missing ? Note: Please don't tell me the method is useless, it's just a POC with a local table, I plan to try later with a more "distant" recordset. Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Private Sub Form_Load() Set conn = New ADODB.Connection conn.Open CurrentProject.Connection Set rs = New ADODB.Recordset With rs rs.CursorLocation = adUseClient rs.Open

VBA Error handling on ADODB Connection.Open

心不动则不痛 提交于 2019-12-05 16:36:30
I have an ADODB connection in VBA for connecting to an SQLServer database. I want to catch the error that is raised when connection.Open is called and the given database is unreachable. My code looks like this: Public Function Connect() As Boolean On Error GoTo DBError Dim dbServer As String Dim dbName As String Dim dbUser As String Dim dbPwd As String dbServer = DatabaseSettings.dbServer dbName = DatabaseSettings.dbName dbUser = DatabaseSettings.dbUser dbPwd = DatabaseSettings.dbPwd Dim connectionString As String connectionString = "Server=" & dbServer & ";Database=" & dbName & ";User Id=" &

Reading and working with strings longer than 255 with ADODB Excel 2010 VBA

▼魔方 西西 提交于 2019-12-05 07:51:08
Here' a thing for you guys: I want to read information from from a closed workbook using ADODB in VBA EXCEL. It happens that the strings in the cells in excel sometimes are with a length bigger than 255. And then here is this limitation: http://support.microsoft.com/kb/189897 "Your data may be truncated to 255 characters if the first 8 records for the field(s) being truncated contain 255 or fewer characters. The Microsoft Excel ODBC driver will, by default, scan the first 8 rows of your data to determine the type of data in each column." There is a "solution" for this: setting the

Passing current ADO Record to another function

喜夏-厌秋 提交于 2019-12-05 04:36:06
Perhaps I've spent too much time in .NET, but it seems odd that I cannot easily pass the current Record of an ADO RecordSet to another method. Private Sub ProcessData(data As ADODB.Recordset) While (Not data.EOF) ProcessRecord ([data.CurrentRecord]) ' <-- There is no CurrentRecord property. data.MoveNext Wend End Sub Private Sub ProcessRecord(singleRecord As ADODB.Record) ' Do stuff. End Sub The scant info I've found on the subject says to pass the entire RecordSet or to create a new Record and manually copy each field to it. StackOverflow, is there a better way? Personally, I would pass the

Are multiple JOINs unavailable when using ADODB to query an Excel file in a VBA procedure?

怎甘沉沦 提交于 2019-12-05 03:28:49
问题 I have 3 sheets with data formatted as tables. The sheets names are "Riesgos", "Eventos" and "EventosRiesgos". EventosRiesgo has information relating events and risks (many to many relationship). I'm trying to get all the risks from Riesgos, but also the events related to the risks from (. I'm using ADODB to query the sheets as database tables and using the following SQL: SELECT * FROM [Riesgos$] r LEFT JOIN [EventosRiesgos$] er ON r.[Id]=er.[Id Riesgo] LEFT JOIN [Eventos$] e ON er.[Id Evento