adodb

Parameterised IN Clause in prepared statement using MySql,PHP and ADODB

穿精又带淫゛_ 提交于 2019-12-01 05:19:35
问题 I am writing some SQL and using AdoDb to connect to my database and run the queries and so on. I am using parametrized queries and have run into a snag. Is their a way to pass an array of values to an in_clause in AdoDb/MySql for parametrization. My problem is that if I pass a prepared string as the parameter i.e. 'test','test2','test3' it does not work as the library or database auto escapes it and adds external quotes at the start and end so all the internal quotes are then auto escaped

Calling SQL Stored Procedure with Output Parameter in VBScript

喜欢而已 提交于 2019-12-01 04:23:02
I've written a VBScript function to call a stored procedure. In the past, I've written a number of functions calling stored procedures with input parameters, but in this instance, I need to work with an Output parameter. In another application, I call the exact same stored procedure using the Entity Framework, so the stored procedure is fine. Here's my code: Function checkAccess(userid,link) isAllowed = false set cmd = Server.CreateObject("ADODB.Command") cmd.CommandText = "Check_Permission" cmd.ActiveConnection = Conn cmd.NamedParameters = true cmd.CommandType = adCmdStoredProc cmd.Parameters

how do i handle concurrent inserts in mysql table and fetch the correct insert id

拟墨画扇 提交于 2019-11-30 23:13:01
I am using adodb for PHP library. For fetching the id at which the record is inserted I use this function "$db->Insert_ID()" I want to know if there are multiple and simultaneous inserts into the database table, will this method return me the correct inserted id for each record inserted ? The reason I am asking this is because I use this last insert id for further processing of other records and making subsequent entries in the related tables. Is this approach safe enough or am I missing something. Please help me formulate a proper working plan for this so that I can use the last insert id for

Problems in Excel 2013 when using ranges that extend beyond row 65536

扶醉桌前 提交于 2019-11-30 21:36:56
I am trying to perform an ADODB query on a named range in an Excel 2013 workbook. My code is as follows: Option Explicit Sub SQL_Extract() Dim objConnection As ADODB.Connection Dim objRecordset As ADODB.Recordset Set objConnection = CreateObject("ADODB.Connection") ' dataset query object Set objRecordset = CreateObject("ADODB.Recordset") ' new dataset created by the query objConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=" & ThisWorkbook.FullName & ";" & _ "Extended Properties=""Excel 12.0;HDR=Yes;IMEX=1"";" objConnection.Open objRecordset.Open "SELECT *

ExecuteExcel4Macro to get range/charts from closed workbooks

混江龙づ霸主 提交于 2019-11-30 16:08:12
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 consist in getting values and replotting the charts. It works, but I would be happier with a GetChart

ADODB query timeout

筅森魡賤 提交于 2019-11-30 12:20:58
I am trying to open a query, which is timing out. I have tried setting the timeout property, but it doesn't seem to want to accept it. The query takes 34 seconds to execute using MS-SQL Server Management window (SQL Server 2005), so I know I need to increase the timeout. Current code: Public Function retRecordSet(StrSQL) Dim cmd ' as new ADODB.Command Dim rs 'As New ADODB.Recordset Set cmd = CreateObject("ADODB.Command") Set rs = CreateObject("ADODB.Recordset") cmd.ActiveConnection = CurrentProject.Connection cmd.CommandText = StrSQL cmd.CommandTimeout = 0 Set rs = cmd.Execute Set retRecordSet

Error in NVL function,is there any equivalent function like NVL

喜夏-厌秋 提交于 2019-11-30 09:08:42
问题 The below code is written VBScript.but the line Set rs = cmd.Execute throwing an error saying that NVL is not defined. So can you suggest an equivalent of such "NVL" Option Explicit Dim conn, cmd, rs Dim clauses(34), i Dim xlApp, xlBook Dim tempDate,LenDate Set conn = CreateObject("ADODB.Connection") With conn .Provider = "Microsoft.ACE.OLEDB.12.0" .ConnectionString = "Data Source=""D:\AravoVB\GE_Wing_To_Wing_Report - Copy.xlsx"";" & _ "Extended Properties=""Excel 12.0;HDR=Yes""" .Open End

Connection string for Access to call SQL Server stored procedure

情到浓时终转凉″ 提交于 2019-11-30 09:07:33
问题 Using Access 2007, I want to call a stored procedure with one input parameter that returns a recordset. Using ADODB, this is pretty straightforward except for the connection string. I want to be able to derive the server and database names from a particular table, which always points to the correct server and database. (I reconnect to development dbs from time to time for testing by relinking the 100 or so linked tables.) Is there a way to get the server and database name from the tabledef

Using SQLDataReader instead of recordset

假如想象 提交于 2019-11-30 07:06:10
I am new to this and had this question. Can I use SQLDataReader instead of a Recordset. I want to achieve the following result in an SQLDataReader. Dim dbConn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim sqlstr As String = "SELECT Name,Status FROM table1 WHERE id=" + item_id.Value.ToString rs.Open(SQL, dbConn) While Not rs.EOF txtName.Text = rs.Fields.Item("Name").Value ddlstatus.SelectedIndex = 1 rs.MoveNext() End While rs.Close() rs = Nothing dbConn.Close() dbConn = Nothing Can I replace recordset with SQLDataReader and if I can can you please show me the changes in code? Its

Operation is not allowed when the object is closed (Object is not closed)

断了今生、忘了曾经 提交于 2019-11-29 18:23:42
The following code, is generating that error. Set getList = Server.CreateObject("ADODB.Command") getList.ActiveConnection=EV_WikiConn getList.Prepared = true getList.commandtext= "declare @Lookup table(Id int identity(1, 1) , SongTitle nvarchar(512) ) insert into @Lookup(SongTitle)select * from ( values ('Deuce')) as x(a) select A.AlbumName, S.SongTitle , S.Writers , S.Vocals , S.SID , S.TheTime from Albums A inner join Songs S on A.AID = S.AID inner join @Lookup L on L.SongTitle = S.SongTitle order by L.Id" set rsList = getList.execute while not rsList.eof ' Error is on this line here. I