adodb

Does ADODB fail on output parameters with optional input parameters?

霸气de小男生 提交于 2019-12-10 23:15:29
问题 I have a stored procedure in a SQL Server 2008 R2 database with an optional input parameter and an output parameter like this: CREATE PROCEDURE [dbo].[spCreateTicket] ( @TrackingCode varchar(25), @EmailAddress varchar(250) = null, @Ticket varchar(1000), @UserID int, @TicketID int output ) AS SET NOCOUNT ON INSERT INTO dbTicket (TrackingCode, EmailAddress, Ticket, UserID) SELECT @TrackingCode, @EmailAddress, @Ticket, @UserID SELECT @TicketID = SCOPE_IDENTITY() RETURN @TicketID When I invoke

How can I port PHP preg_split to Java for the special case of unserializing a value in ADODB?

半世苍凉 提交于 2019-12-10 22:41:36
问题 I need to port this function for unserializing a value in ADODB to Java. $variables = array( ); $a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); for( $i = 0; $i < count( $a ); $i = $i+2 ) { $variables[$a[$i]] = unserialize( $a[$i+1] ); } I have a library to unserialize the values the php way, but I need help on porting over the preg_split. What would this regex look like in Java? 回答1: Equivalent java code : import java.util.List; import

VBScript / ADODB Syntax Issue with adArray?

我们两清 提交于 2019-12-10 20:16:31
问题 I'm hoping somebody could provide me with some fresh eyes on my vb script. The main purpose of this script is to execute a stored procedure using some parameters. The error I get is 'Expected end of statement' I haven't done much VB scripting but from what I have found so far - this error has been down to some kind of syntax issue. I've looked over this script for many hours and can't see anything obvious. I can only assume it's down to the declaration of adArray (which doesn't look right in

Oracle 11g ado connection strings for ODBC (not OLEDB) using excel VBA 64 bit (DSN Less and tnsnames)

帅比萌擦擦* 提交于 2019-12-10 19:22:17
问题 Please help. I have researched this for hours. I get some parts to work but not others. What I am trying to do is write all the connection strings in excel VBA to connect to Oracle 11g database. I don't want to set up the User DSN in ODBC Administrator and I don't want to have to maintain a tnsnames.ora file. I can get this to work for OLEDB connection strings but I believe this is no longer supported by Oracle so I want to use the Oracle ODBC Driver commands only. This is what I have got to

Fill Userform with data from closed workbook, based on 2 criteria

£可爱£侵袭症+ 提交于 2019-12-10 12:19:11
问题 I am having trouble using ADODB to search data in a closed workbook, narrow by team (think A, B, C, D) and Date and fill a userform in the active workbook with the data from the closed workbook. My first issue is with getting the connection string to work, the file I am trying to reach is in the same directory but ThisWorkbook.Path doesn't seem to be working. The data I am trying to pull is Team, Date, Product, Staffing, Processing Issues, and Packaging Issues. Also I am unsure how to use the

Excel table loses number formats when data is copied from ADODB recordset

陌路散爱 提交于 2019-12-10 03:01:26
问题 I'm updating an excel table from an ADODB recordset using the CopyFromRecordset method. After the update, the numbers show up as dates wherever there are number columns. The workaround I used until now is to format the columns back to numbers through VBA , but it's not a good solution as takes more time for the report to complete. Also I have to write code to accommodate a lot of tables. Is there a quick fix? Any help is greatly appreciated. 'Delete old data and copy the recordset to the

Finding The DSN To My Database?

孤人 提交于 2019-12-10 01:28:38
问题 I have an SQL database and want to connect to it using VBA in order to support some legacy functionality. I'm using an ADODB connection and need to know what my database DSN is. How can I find this? I'm using SQL Server 2008, thanks! :D 回答1: A DSN is an indirect way of referring to the database. You have to create them manually (or semi-automatically using a wizard of some kind). Go to ControlPanel->AdministrativeTools->DataSources (ODBC) to see if one has already been defined for the

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

Windows Script Host (jscript): how do i download a binary file?

有些话、适合烂在心里 提交于 2019-12-09 06:22:27
问题 i'm trying to automate a file download with Windows Script Host (JScript). i see ADODB.Stream has an Open method whose documentation makes it seem like it should be possible to open a HTTP URL and stream the response body: var url = 'http://example.com/example.tar.gz'; var path = 'example.tar.gz'; var input = WScript.CreateObject('ADODB.Stream'); input.Open(url); input.SaveToFile(path); input.Close(); But it bombs on the Open call with (null): Object or data matching the name, range, or

ExecuteExcel4Macro to get range/charts from closed workbooks

…衆ロ難τιáo~ 提交于 2019-12-09 00:18:37
问题 I use these lines to get values from closed workbooks: Arg = "'" & Path & "[" & File & "]" & Sheet & "'!" & "R4C4" Arg = CStr(Arg) GetValue = ExecuteExcel4Macro(Arg) Is there an other way than loop to get values from a range ? The loop solution is working but It would be clearer if I can get range directly with ExecuteExcel4Macro. I've tried to input a range in Arg, but it doesn't work. It returns an error. I have the same question for charts, how can I get them ? My solution for the moment