ado

Classic ASP - ADO execute Stored Procedure passing in parameters

回眸只為那壹抹淺笑 提交于 2020-01-10 09:01:09
问题 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(

Updating Oracle Table from Excel VBA Macro using ODBC connection

爷,独闯天下 提交于 2020-01-10 05:38:05
问题 I have a sheet in Excel 2010 which pulls data in QueryTables from an Oracle database, connected via an ODBC DSN. I need to take data from the spreadsheet and use it to update a table in the same Oracle database. I cannot do an update from a QueryTable, but that is the only connection method I have been able to get to work with the ODBC. I have tried setting up a ADODB connection, but I am getting a 'Run-time error '-2147467259 (80004005'): Automation error Unspecified error Here is the code I

How to name ADO connection while creating it in Excel VBA

纵饮孤独 提交于 2020-01-07 07:59:10
问题 How to name ADO connection with VBA? Using ADO method of the following VBA code adds new connection which is named by default "Connection" or "Connection2" etc. Sub Make_ADO_Connection() Sheets(2).Cells.ClearContents Dim oCn As ADODB.Connection Dim oRS As ADODB.Recordset Dim ConnString As String Dim SQL As String strFile = ThisWorkbook.FullName ConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strFile & ";Extended Properties=""Excel 12.0;HDR=Yes;IMEX=1"";" Debug.Print ConnString

Why am I getting unexpected error in ado with classic asp?

自古美人都是妖i 提交于 2020-01-07 05:34:27
问题 I have this (I have a connection above all this not shown): Set cmd = Server.CreateObject("ADODB.Command") Set cmd.ActiveConnection = conn cmd.CommandType = 1 cmd.Parameters.Append .CreateParameter("LASTNAME", 200, 1, 50, "JONES") cmd.CommandText = "select * from employees where lastname = ?" cmd.Prepared = True Set rs = cmd.Execute As soon as I execute I get: Active Server Pages error 'ASP 0115' Unexpected error myasppage.asp A trappable error (C0000005) occurred in an external object. The

Why is this Exception?- The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects

冷暖自知 提交于 2020-01-07 05:23:07
问题 I m getting this Exception-"The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects." I ve user table and country table. The countryid is referred in user table. I am getting the above Exception when I am trying to add entry in user table. This is my code- using (MyContext _db = new MyContext ()) { User user = User .CreateUser(0, Name, address, city, 0, 0, email, zip); Country country = _db.Country.Where("it.Id=@Id", new

How Do I Copy a table from one Access DB to another Access DB

核能气质少年 提交于 2020-01-06 03:08:07
问题 I am trying to automate a process to create a secondary database from a primary. Both DB's (MS Access) contain one table; the table in the secondary DB is a subset of the table in the primary. Is there a simple way to copy a recordset frone one DB to another? I am using VBScript and ADO. Thanks! 回答1: Try the CopyObject method: DoCmd.CopyObject "DestinationDatabaseName", "NewName", acTable, "SourceTable" 回答2: You can run Insert queries referencing external Access database files files (MDB,

Excel VBA ADO Cutting Decimals (Possible Bug in ADO?)

隐身守侯 提交于 2020-01-05 05:34:07
问题 Can anybody help me with this please? The problem : I have the below code in a module which works perfectly usually, but when i run it on this sample file, I noticed that the decimals in the "Upper Limit" (column D) are cut. A temporary solution i found was that i had to modify in the sample file the upper limit from 1 to 1.0 (so to add ".0" at the end) at line 26 to make it look like a decimal number. After this the decimals were imported correctly on the sheet. But, this is not a solution.

Error 440 in Visual Basic Application

删除回忆录丶 提交于 2020-01-04 17:01:55
问题 There is an old VB application running at one of my clients. An exception is throws in this peice of code: cn=GetIndexDatabaseConnectionString() sSql="SELECT * FROM Arh_Naroc WHERE StNarocila = '" & isci & "'" rs=CreateObject("ADODB.Recordset") Call rs.Open(sSql,cn) The exception happens in rs.Open() function. "Error number 440 occured." This are SBL scripts for KOFAX engine and it's many years old. The whole SW was transferred from old XP computer to Windows 7 and looks like there are

TAdoquery date format

流过昼夜 提交于 2020-01-04 12:50:14
问题 I am Java developer. I have some old program in Delphi. In old version they work with mdb . I fixed it for connection with SQL Server. All SQL queries are implemented with TAdoQuery . qryTemp.SQL.Text:='select sum(iif(ComeSumm>0,comesumm,0)),sum(iif(lostSumm>0,lostsumm,0)) from cash '+ 'where (IdCashClause is null or idcashclause<>8) '+ ' and cashNum='+IntToStr(i)+ ' and CashType=0'+ ' and format(PayDate,"dd/mm/yyyy")=format('''+DateToStr(Date)+''',"dd/mm/yyyy") '; The program throws an

Insert raw file data into BLOB (“OLE Object”) field of Access table using ADO

[亡魂溺海] 提交于 2020-01-04 12:48:12
问题 I am trying to insert a file into MS Access database, into a field of OLE Object type. I am using C++ and ADO . Currently I get error Invalid pointer error . I think that my problem is mishandling variants since this is the first time I use them. I am learning from this code example but have problem understanding how to insert file from disk into variant . They read it from database, and copied it into new record so the part where I read file from disk and then insert it into variant is