ado

code critique - am I creating a Rube Goldberg machine?

懵懂的女人 提交于 2020-01-16 04:14:09
问题 I'm making a fair amount of calls to database tables via ADO. In the spirit of keeping things DRY, I wrote the following functions to return an array of values from a recordset. Is this hare brained? I use it mainly for grabbing a set of combo-box values and the like, never for enormous values. Example Usage (error handling removed for brevity): Function getEmployeeList() getEmployeeList= Array() strSQL = "SELECT emp_id, emp_name from employees" getEmployeeList = getSQLArray( strSQL, "|" )

VBScript SQL select query clarification and variable substitution

混江龙づ霸主 提交于 2020-01-15 23:45:10
问题 I have read this entry (http://stackoverflow.com/questions/8513185/vbscript-to-correctly-re-format-a-delimited-text-file) many times and still do not understand the .Execute section. WScript.Echo oTDb.Execute(Replace("SELECT * FROM [@T]", "@T", sTbl1)) _ .GetString( adClipString, , "|", vbCrLf, "" ) The pieces I am having trouble with are the [@T] and "@T". I know it is the "@T" that is reading the filename in the schema file and and the [@T] must be using the "@T" as a substitute. What I

SQL RANK() equivalent for VBA ADODB.Recordset

邮差的信 提交于 2020-01-15 12:15:24
问题 I'm trying to write an SQL query in VBA for an ADODB.Recordset object that generates a calculated rank field. Using transact-SQL does not work as seen in the sample here. strSQL = "SELECT DISTINCT [MONTH-YYYY], Location, (SUM([O/T Earnings])/SUM([Monthly Earnings])) AS OT_AS_PCT " strSQL = strSQL & "RANK() OVER (PARTITION BY [MONTH-YYYY] ORDER BY (SUM([O/T Earnings])/SUM([Monthly Earnings])) DESC) AS RANK " strSQL = strSQL & "FROM [Overtime Data$] " strSQL = strSQL & "GROUP BY [MONTH-YYYY],

Excel VBA Array not receiving all values from stored procedure recordset - different result than running stored procedure outside of Excel

放肆的年华 提交于 2020-01-15 06:53:56
问题 I have quite a conundrum which I have been trying to troubleshoot. I have a stored procedure in a MySql database, which I call through an Excel VBA application. The VBA application passes the recordset into an Array, and then I use a For Loop to place each of the items in the Array onto a worksheet. Here's the problem: two of the values in the recordset keep coming back blank in Excel. Oddly, the two are in the middle of the Array, not the beginning or end. However, if I call the stored

How to use SQLite in c# without an ADO wrapper

与世无争的帅哥 提交于 2020-01-13 19:38:07
问题 Is this even possible? All of the aritcles I have read state that an ADO wrapper is necessary, but the SQLite website implies that nothing other than their DLL is needed. IF it is possible, then I would expect there to be code examples out there. 回答1: Look here: http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers Specifically, search for ".NET Framework". One of there wrappers there: http://www.phpguru.org/static/SQLite.NET.html - this one does not use ADO, it's just an extremely lightweight

ADO.NET SQL Server Performance bottleneck

自闭症网瘾萝莉.ら 提交于 2020-01-13 07:21:21
问题 I have a sql connection that I have to hit the database anywhere from 500 to 10,000 times a second. After about 250 per second things start to slow down and then the app gets so far behind it crashes. I was thinking about putting the database into a dictionary. I need the fastest performance I can get. Currently the ado.net takes about 1 to 2 milliseconds but something happens that causes a bottleneck. Is there anything wrong with the below syntax for the 10k queries per second? is a

ADO.NET SQL Server Performance bottleneck

青春壹個敷衍的年華 提交于 2020-01-13 07:21:11
问题 I have a sql connection that I have to hit the database anywhere from 500 to 10,000 times a second. After about 250 per second things start to slow down and then the app gets so far behind it crashes. I was thinking about putting the database into a dictionary. I need the fastest performance I can get. Currently the ado.net takes about 1 to 2 milliseconds but something happens that causes a bottleneck. Is there anything wrong with the below syntax for the 10k queries per second? is a

Why the output parameter of my ADODB.Command does not retrieve a value when executing?

半城伤御伤魂 提交于 2020-01-11 06:53:08
问题 I have a code in Classic ASP and SQL Server, the idea is simple, to have an stored procedure so you can insert a file but before that, the sp will check if the file already exists, after that will return an output parameter so I can check it on my asp page. The problem is the returning value of the output parameter is nothing, I cann´t figure out where is the problem.. The SP is: ALTER PROCEDURE [dbo].[pi_usu_crear_cuenta] @msg_salida char(1) OUTPUT /* 0=Registro ya existe, 1=Insert

Classic ASP - ADO execute Stored Procedure passing in parameters

ぃ、小莉子 提交于 2020-01-10 09:04:17
问题 I am needing to pass parameters into a stored procedure with Classic ASP. I do see some people using the Command object and others NOT using it. My sproc params are like this: @RECORD_NUMBER decimal(18,0), @ErrorType nvarchar(100), @INSURANCE_CODE smallint, @CompanyId int, @INS_ID_NUM nchar(22) Then I'm trying to do this: Dim conn, rsSet,rsString, cmd Dim RN,ET,IC,CI,IIN RN = Request.Form("Record_Number") ET = Request.Form("ErrorType") IC = Request.Form("INSURANCE_CODE") CI = Request.Form(

Classic ASP - ADO execute Stored Procedure passing in parameters

霸气de小男生 提交于 2020-01-10 09:02:52
问题 I am needing to pass parameters into a stored procedure with Classic ASP. I do see some people using the Command object and others NOT using it. My sproc params are like this: @RECORD_NUMBER decimal(18,0), @ErrorType nvarchar(100), @INSURANCE_CODE smallint, @CompanyId int, @INS_ID_NUM nchar(22) Then I'm trying to do this: Dim conn, rsSet,rsString, cmd Dim RN,ET,IC,CI,IIN RN = Request.Form("Record_Number") ET = Request.Form("ErrorType") IC = Request.Form("INSURANCE_CODE") CI = Request.Form(