VBA, ADO.Connection and query parameters

You need to use an ADODB.Command object that you can add parameters to. Here’s basically what that looks like Sub adotest() Dim Cn As ADODB.Connection Dim Cm As ADODB.Command Dim Pm As ADODB.Parameter Dim Rs as ADODB.Recordset Set Cn = New ADODB.Connection Cn.Open “mystring” Set Cm = New ADODB.Command With Cm .ActiveConnection = Cn .CommandText … Read more

How to deploy SQL Server Compact Edition 4.0?

i’ve created the solution. SQL Server Compact Edition is comprised of 7 dlls: sqlceme40.dll The undocumented, native, flat API library (The .net System.Data.SqlServerCe.dll assembly is a wrapper around this dll) sqlceca40.dll A COM dll that implements Engine, Replication, Error and a few other COM objects sqlceoledb40.dll A COM dll that implements an OLEdb provider for … Read more

Is there a way to retrieve the view definition from a SQL Server using plain ADO?

Which version of SQL Server? For SQL Server 2005 and later, you can obtain the SQL script used to create the view like this: select definition from sys.objects o join sys.sql_modules m on m.object_id = o.object_id where o.object_id = object_id( ‘dbo.MyView’) and o.type=”V” This returns a single row containing the script used to create/alter the … Read more