ado

Delphi, using vbscript for connecting ADO, new Be

Connecting to ADO is hard from installation in Delphi, so I decided to use VBscript, which I have never used before. VBscript has little support in Delphi, so how do I run a Windows script editor to get support and carry it over to Delphi? I do not understand the statements in VB script very well yet My Delphi TTable is connecting to ...

ADO LIKE query in ASP (vbs)

I have a query like this: SELECT TaFellesVaktjournal.*, TaBygg.ByggNavn FROM TaFellesVaktjournal LEFT JOIN TaBygg ON TaFellesVaktjournal.VaktFellesByggNavnId = TaBygg.ByggBudsjtilstEiendom WHERE VaktjFellesDato >= @dtfr AND VaktjFellesDato <= @dttl AND (VaktFellesSak = @sok OR VaktjFellesHendelse = @sok) ORDER BY VaktjFellesDato DESC, V...

BDE to ADO conversion in DELPHI 2010

I am working on converting BDE to ADO for my company. I have run into an expression I can not figure out how to convert to ADO Here is the BDE expression with all the ADO changes except for one....the part that is causing me issues is the with Tquery.Create(nil) do at the beginning. Any ideas? with Tquery.Create(nil) do beg...

Reading a unicode string from SQL Server with Delphi 6

Hello, I need to read a nvarchar(max) field from a SQL Server 2008 database using Delphi 6 and ADO. I can handle the unicode text just fine but it seems the ADO component is "preconverting" the string to code page before I even get to have a look at it. I've tried accessing the field as a TBlobField but it gives me the converted ve...

Getting ID of new record after insert

I'm just getting my head around insert statements today after getting sick of cheating with Dreamweaver's methods to do this for so long now (please don't laugh). One thing I'm trying to figure out is how to get the ID value of a newly inserted record so I can redirect the user to that page if successful. I have seen some examples whic...

Are there OCI8 replacements for ADO MoveFirst and EOF, BOF?

I am researching the possibility of porting an application written in classic ASP with ADO record sets and an Oracle database to PHP5 and OCI8. We have lots of stored procedures and queries with bind variables for performance. My problem is that we have become lazy from using the ADO classes and the EOF and BOF indicators along with Mo...

Classic ASP SQLNCLI connection string returns empty recordsets that worked fine with SQLOLEDB

Trying to switch to SQLNCLI so I can use varchar(max) fields in my ASP application. No records are returned from a query that worked fine under SQLOLEDB. The connection string opens as follows: ConnStr="Provider=SQLNCLI10;Server=129.118.139.78,8888;Server=UWCTest;Uid=user;Pwd=pass;DataTypeCompatibility=80;MARS Connection=true;" oConn....

Using Multiple Temporary tables in Delphi with an ADO connection to the database produces errors

I'm having an issue with temp tables using an ADO connection to my database. The select into queries run fine, but it seems that they are dropping the tables after each select into. Their is no open recordset so I am unsure as to why the tables are dropping, it shouldn't be opening a 2nd ADO connection that I can see. Any idea what I ca...

Why is my asp.net causing a runtime error?

I am trying to connect to a database on my local server. The database is called "dbtest." Of course, I have left off my actual password and replaced it with "password." This is the typical code I see on every tutorial, but it doesn't work at all. Please help. <% Dim con, rs con = Server.CreateObject("ADODB.Connection") 'I thin...

Return value indicating update success/failure of SQL Server stored procedure via ADO/VBA

I have a SQL Server 2008 stored procedure that updates values in a table. I would like to have the stored procedure return an integer value indicating that the update was successful (return 0) or not (returns error number). What would be the best way to accomplish this via ADO and VBA? Here some of my code in simplified form that perform...

Update value from a select statement

Hi there, I'm using an Access over Oracle database system (Basically using Access for the forms and getting into the tables using ADO code) and am trying to update a field in the product table with the value of the same named field in a load table. The code I am using is: .CommandText = "UPDATE " & strSchema & ".TBL_CAPITAL_MGMT_PRODUC...

Using ConnectionString instead of TAdoConnection on a TAdoQuery

I have derived my own component from TAdoQuery in Delphi. I have overridden the DoAfterPost procedure; and in this code I create another query for the purpose of fetching the primary key associated with an inserted record (i.e. SELECT @@IDENTITY for SqlServer, SELECT LAST_INSERT_ID() for MySql, etc). In the past I always used TAdoConne...

Access 2007 upgrade DAO references conflict

I am updating an Access 97 DB w/ VBA code to Access 2007. The VBA code uses DAO objects that Access 2007 references when I converted the db files (first from 97 to 2002, then to 2007). My problem specifically is with the two references: "Microsoft DAO 3.6 Object Library" and "Microsoft Office 12.0 Access database engine Object Library...

Database advice needed: porting VB6/ADO/JET app to VB.NET

I need to update (well, rewrite really) a SMALL VB6 application which uses ADO to access a JET database, to a vb.net app in Visual Studio 2008. My research suggests that I should use LINQ, but it doesn't seem to be possible to connect to JET. If JET is now deprecated, what should I use? Or should I use ADO.NET without LINQ? Please don'...

How to create an ADODB Recordset From a Table Valued Function with Named Parameters

This works: Dim rst As New ADODB.Recordset rst.Open "SELECT * FROM dbo.ftblTest(1,2,3)", CP.Connection, adOpenKeyset, adLockReadOnly But it would be nicer to do this: rst.Open "SELECT * FROM dbo.ftblTest(@Param1=1,@Param2=2,@Param3=3)", CP.Connection, adOpenKeyset, adLockReadOnly If I try the second method I get the error: "paramet...

Delphi & ADO: datetime to string conversion

Hi, I use Delphi 2006 and ADO to connect to a MS Access database. Some of the fields I retrieve are Date fields (in Access formatted as "Medium Date" i.e. 20-Apr-2010) however I have to retrieve them as Strings: FValue:=FAccessADOQuery.Fields.FieldByName(FIELD_NAME).AsString; and then the fields are formatted as follows: 4/20/2010. ...

Incorrect syntax near the keyword 'with' (SQL)

Hi Guys, I have a little bit of an odd issue. When I run this SQL: with ID_Table as ( select row_number() over (order By SS_ID) As row_id, ss_id from slide_show ) select t0.* from ID_Table as t1 inner Join slide_show as t0 on t1.ss_id = t0.ss_id where t1.row_id between 0 and 1 order by t...

update and delete single access record set via excel vba

I have this tool where employee information needs to be updated. I call in the MDB data to excel in one sheet. Now I use vlookup to see what is there and change it if needed. I have tried some tricks however some thing seems to be wrong.. please help. Sub update() Dim cn As Object Dim rs As Object Dim a As String strFile = "D:\temp exc...

Is ADO unable to report a database is marked read-only?

If "read only" is checked in the Windows desktop properties for a .dbf or .mdb file, and a Delphi 6 ADO connection (say, via Jet for an .mdb file or ODBC for a .dbf file) is then used to open that database, TADOTable.CanModify returns true and TADOTable.ReadOnly returns false, apparently failing to detect the file is actually read-on...

Connection string syntax for Classic ADO / ODBC / Oracle 10g EZConnect

I'm trying to connect various VBA projects to an Oracle 10g back end using ADO (2.8) and no TNS. After various attempts, we've decided that the simplest series of steps for a clean installation include: Set up an Oracle Instant Client Install the accompanying ODBC driver (Test the connection using EZCONNECT via SQL Plus) (Test the conn...