Trigger That Runs An Macro Access

Feb 14, 2005

Hi,

can I run a macro Access from a trigger ?

View 14 Replies


ADVERTISEMENT

Need Help With SQL Macro In MS Access

Aug 27, 2005

Having trouble with this assignment. My teachers say it should work but itjust doesn't. This part of a macro is designed to take payment from the costand show the balance owing. What am I doing wrong. The sql is shown below.No error message is showing but the process still dosen't work.UPDATE [wedding] INNER JOIN deal ON wedding.deal = deal.deal SETwedding.balance = (deal!cost - [wedding]!paid)

View 1 Replies View Related

SQL Command To Process An Access Macro?

Jul 20, 2005

Here's the scenario. Using a campaigning applicaion for aneNewsletter. It writes to an Access table. I have an ASP web page thatwrites to another table. I chained 3 Access queries together into aMacro to copy that data to the campaigning table, give a numericidentifier to that record, and then delete all records with thatidentifier (in the 2nd table). This will keep the ASP > Access tableclean.The campaigning software allows for a pre-processing SQL command tobe run. I would like to automate the updating of the table byinitiating this Access Macro from the SQL command. Anyone have anyideas on the command/syntax?Thanks in advanceJasonJoin Bytes!

View 1 Replies View Related

Running Access XP Macro With Script Task

Feb 24, 2007

I found this and have done everything it says to do, but I can't get the script to compile. Any ideas on how to run a access macro in SSIS??



Baiscally to execute an Access Macros in SSIS package we need to Download

Microsoft.Office.Interop.Access DLL from Office XP PIAs.

Download site

http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en

1) Extract the Microsoft.Office.Interop.Access DLL from Oxppia.exe

2) Drag and Drop Microsoft.Office.Interop.Access DLL to Global Assembley Directory(GAC) ie: C:WINNTassembly for Windows 2000 -- C:WINDOWSassembly for ( Win Xp and Win 2003)

3) Copy paste Microsoft.Office.Interop.Access to C:WINNTMicrosoft.NETFrameworkv2.0.50727 for Windows 2000 -- C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 ( Win Xp and Win 2003)

4) Add DLL reference in the Script Task

5) Add the below Code



1) Create a New Project in SSIS

2) Drag and Drop Script Task

3) Copy Paste the code in script task editor




Imports Microsoft.Office.Interop.Access

Try

Dim objAccess As New Access.Application

objAccess.OpenCurrentDatabase("D:TestMacro.mdb", False) ' Add the Access File Path

objAccess.DoCmd.RunMacro("Macro1") ' Replace Macro1 with the name of your macro

objAccess.CloseCurrentDatabase()

objAccess.Quit(Access.AcQuitOption.acQuitSaveNone)

objAccess = Nothing

Catch ex As Exception

System.Windows.Forms.MessageBox.Show(ex.ToString())

End Try

Dts.TaskResult = Dts.Results.Success

View 7 Replies View Related

Trigger Error When App Runs

Oct 5, 2005

I have SQL Server 2000, and our web application is in WebObjects.

I built a trigger on a table that indicates if certain fields in a record have been changed since the last time a report was run from the application.

This trigger runs fine through the Query Analyzer, and runs fine with a direct input through enterprise manager. However, when the WebObjects application tries to update the table, and error is thrown.

Is anyone familiar with a reason why an application would throw an error on an update, when the DB tools do not? If we disable the trigger, the application has no problem updating the table.

Here is the relevant portion of the trigger:

create trigger t_press_run_change
on dbo.press_run_line_item
for insert, update, delete
as

updatepress_run_line_item
setis_changed = 1
from deleted d
join press_run_line_item p on p.press_run_line_item_id = d.press_run_line_item_id
where(p.is_changed = 0 or p.is_changed is null)
AND ((isNull(p.print_quantity,0) <> isNull(d.print_quantity,0))
OR (isNull(p.spoilage_pct,0) <> isNull(d.spoilage_pct,0))
OR(isNull(p.ad_dimension_id,0) <> isNull(d.ad_dimension_id,0))
OR(isNull(p.quarter_fold_id,0) <> isNull(d.quarter_fold_id,0))
OR(isNull(p.max_qty_per_shipment,'') <> isNULL(d.max_qty_per_shipment,''))
OR(isNull(p.packaging_max_height,'') <> isNull(d.packaging_max_height,''))
OR(isNull(p.packaging_max_weight,'') <> isNull(d.packaging_max_weight,''))
OR(isNull(p.packaging_skids,'') <> isNull(d.packaging_skids,''))
OR(isNull(p.packaging_turns,'') <> isNull(d.packaging_turns,''))
OR(isNull(p.packaging_cartons,'') <> isNull(d.packaging_cartons,''))
OR(isNull(p.preprint_delivery_time,'') <> isNull(d.preprint_delivery_time,''))
OR(isNull(p.contact_id,0)<> isNull(d.contact_id,0))
OR(isNull(p.address_company,'')<>isNull(d.address_company,''))
OR(isNull(p.address1,'')<>IsNull(d.address1,''))
OR(isNull(p.address2,'')<>IsNull(d.address2,''))
OR(isNull(p.address_city,'')<>IsNull(d.address_city,''))
OR(isNull(p.address_state,'')<>IsNull(d.address_state,''))
OR(IsNull(p.address_zip,'')<>IsNull(d.address_zip,''))
OR(isNull(p.address_Country_id,'')<>IsNull(d.address_country_id,''))
OR(isNull(p.client_printer_id,'')<>IsNull(d.client_printer_id,'')))

View 2 Replies View Related

Trigger That Runs On Update

Feb 7, 2008

I'm new to SQL and am having some trouble figuring out Triggers. We use Microsoft Dynamics SL (formerly Solomon) for our accounting. We have a table that only has data in it while we're processing checks called PRCHECKTRAN. We'd like to build a report that uses the information in this table but it's only available until we "keep" the checks that we're printing. This creates an added step because we have to stop our Payroll process to go out and print the reports. It's been suggested to use a trigger to make a copy of the records in the PRCHECKTRAN table so we've got them after the checks are "kept." We're wanting something that's done behind the scenes so the user can continue to do things the way they always have while giving us access to the data past the payroll period.

Basically as soon as we calculate checks, PRCHECKTRAN is populated. Once the checks are accepted as good, PRCHECKTRAN is cleaned out. I think I need an update or insert trigger that copies all records over to another table that we'll create called something like PRCHECKTRAN_HOLD. I'm just not familiar enough with SQL to write it. Any direction you can provide would be greatly appreciated. Thanks.

View 3 Replies View Related

SQL Pass Through Query Runs Twice From Access

Jul 18, 2007

Hi All,



Recently we started using Pass throughs to perofmr large inserts, however we have started to notice that some of these pass throughs are executing twice, and therefore duplicating data.



Is this a known bug, and if not has anyone got any advice on what could be causing it?



We're connecting from Access 2002 (SP6) to SQL Server 2000 Enterprise.



The conenction string / code is as follows :-



Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.Properties("Jet OLEDBDBC Pass-Through Statement") = True
cmd.Properties _
("Jet OLEDB*** Through Query Connect String") = _
"ODBC;DSN=" & myDatabaseShort & ";DATABASE=" & myDatabase & ";UID=sa;PWD=" & Left(myDatabaseShort, 4) & ";"



It connects fine. My sql string is a straightforward Insert statement that only executes once via SQL Query Analyzer.



I'm calling the pass through using the following lines of code:-



cmd.CommandText = mysql
cmd.Execute



Can anyone see anything obvious that I'm doing wrong, or is this a known issue?


Cheers

View 5 Replies View Related

A Procedure Runs Slow As A Job But Runs Fast Executed In A Query Window

Apr 23, 2008

Performance issue.


I have a very complex Stored Procedure called by a Job that is Scheduled to run every night.
It's execution takes sometimes 1 or 2 hours and sometimes 7 hours or more.

So, if it is running for more than 4 hours I stop the Job and I run the procedure from a Query Window and it never takes more than 2 hours.

Can anyone help me identify the problem ? I want to run from the Job and not to worry about it.

Some more information:
- It is SQL 2000 Enterprise with SP4 in a Cluster (It happens the same way in any node).
- The SQL Server and SQL Agent services run using a Domain Account that have full Administrative access.
- When I connect to a Query Window I also use a Windows Account.

- There is no locks or process bloking or being blocked while the job is running.
- Using the Task Manager the processor activity is ok, no more than 30 % in any processor.

View 15 Replies View Related

Stored Procedure Just Runs And Runs

Oct 9, 2001

I have a stored proceedure (which I will tag on at the end for those interested) which is taking at least 15 minutes to run when executed, but completes in 1 minute when the tsql statement is run in Query Analyser. Why is this?

I suspect that it may be connected to table indexing, but why then is this bypassed when QA is used?

Any advice appreciated.

Derek


************************************************** ***********************
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'dbo.sp_ValidateAIGL') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE dbo.sp_ValidateAIGL
GO

CREATE PROCEDURE dbo.sp_ValidateAIGL
@IGLPeriodIDInt,
@IGLProgramIDInt

AS
/* ************************************************** ************************
Name:sp_ValidateIGL
Author:CL
Date:19-Jan-2001
Notes:
************************************************** ************************ */

--SET NOCOUNT ON

DECLARE@TaxYearChar(5),
@FrequencyChar(1),
@PeriodNo Int,
@ProgramLogIDInt

SELECT@TaxYear = TaxYear,
@PeriodNo = PeriodNo,
@Frequency = Frequency
FROMtbl_IGLPeriods
WHEREIGLPeriodID = @IGLPeriodID

SELECT @ProgramLogID = (SELECT ProgramLogID FROM tbl_SYSProgramLogs WHERE IGLProgramID = @IGLProgramID AND IGLPeriodID = @IGLPeriodID)

CREATE TABLE #IGLErrors
(
KeyFieldChar(24),
ErrorIDInt,
DescriptionVarChar(255)
)

-- *** Global Non Program Specific Data Errors ***
-- CHECK - that there are records in the DEB_IGL_PAYROLL_OUTPUT file.....none and the routine failed...
IF NOT EXISTS(SELECT * FROM tbl_OUT_Payroll WHERE IGLProgramID = @IGLProgramID)
INSERT INTO #IGLErrors SELECT NULL, 100, 'No records were processed by the IGL run!'

SELECT * FROM #IGLErrors

-- CHECK - search for any records where the employee's EXPENSE_CODE is NULL
INSERT INTO #IGLErrors
SELECT DISTINCT
NULLIF(EmpNo, ''),
2,
'Employee "' + COALESCE(NULLIF(RTRIM(EmpNo), ''),
'<Missing Employee>') + '" (Organisation Unit - ' + COALESCE(RTRIM(OrgUnitCode),
'<No Organisation Unit>') + ') does not have a EXPENSE_CODE Code.'
FROM tbl_OUT_Payroll
WHERE NULLIF(ExpenseCode, '') IS NULL
ANDIGLProgramID = @IGLProgramID

SELECT * FROM #IGLErrors
-- CHECK - check that the BALANCE of DEBITs match the balance of CREDITs
IF (SELECT SUM(Cash) FROM tbl_OUT_Payroll WHERE IsCredit = 1 AND IGLProgramID = @IGLProgramID) <> (SELECT SUM(Cash) FROM tbl_OUT_Payroll WHERE IsCredit = 0 AND IGLProgramID = @IGLProgramID)
INSERT INTO #IGLErrors SELECT NULL, 3, 'The total cash value for DEBIT elements does not match the total cash for CREDIT elements.'

SELECT * FROM #IGLErrors
-- *** Program 1 and 2 errors ***
IF @IGLProgramID IN (1, 2)
BEGIN
-- CHECK - search for any records where the employee's COST_CENTRE is NULL
INSERT INTO #IGLErrors
SELECT DISTINCT
NULLIF(EmpNo, ''),
1,
'Employee "' + NULLIF(RTRIM(EmpNo), '') + '" (Organisation Unit = ' + RTRIM(OrgUnitCode) + ') does not have a COST_CENTRE Code.'
FROM tbl_OUT_Payroll
WHERE NULLIF(CostCenter, '') IS NULL
ANDIGLProgramID = @IGLProgramID

SELECT * FROM #IGLErrors

-- Check for EMPLOYEEs that were not transfered to the PAYROLL output (usually caused by missing ORG_UNITs or not picked up in
-- the DEB_VIEW_APPOINTEE view...)
INSERT INTO #IGLErrors
SELECT DISTINCT
EMP_NO,
11,
'Employee "' + RTRIM(EMP_NO) + '" was excluded from the summary. Check their Organisation Unit codes!'
FROM PSELive.dbo.COSTING_OUTPUT
WHERENOT EMP_NO IN (SELECT DISTINCT EmpNo FROM tbl_OUT_Payroll WHERE IGLProgramID = @IGLProgramID)
ANDPERIOD_NO = @PeriodNo
ANDTAX_YEAR = @TaxYear

SELECT * FROM #IGLErrors

-- Check that there are no ELEMENTS in the COSTING_OUTPUT table that don't exist in the tbl_IGLElements table
INSERT INTO #IGLErrors
SELECT DISTINCT
ELEMENT,
12,
'Element "' + RTRIM(ELEMENT) + '" does not exist in the IGL Interface Elements table!'
FROM PSELive.dbo.COSTING_OUTPUT
WHERE ELEMENT NOT IN
(
SELECT DISTINCT Element
FROM tbl_IGLElements
)
ANDPERIOD_NO = @PeriodNo

SELECT * FROM #IGLErrors

END

-- *** Add a error to indicate the number of errors ***
IF EXISTS (SELECT * FROM #IGLErrors)
INSERT INTO #IGLErrors
SELECT 0,
0,
'Warning, there are ' + CAST(Count(*) AS VarChar(5)) + ' recorded errors!'
FROM#IGLErrors

-- Transfer the records to the ErrorsLog table ready for the user to view...
DELETE FROM tbl_SYSErrorsLog
INSERT INTO tbl_SYSErrorsLog (IGLProgramID, OutputLogID, KeyField, ErrorID, Description)
SELECT@ProgramLogID,
@IGLPeriodID,
KeyField,
ErrorID,
Description
FROM #IGLErrors
ORDER BY ErrorID

DROP TABLE #IGLErrors

SELECT *
FROM tbl_SYSErrorsLog
ORDER BY ErrorID

--SET NOCOUNT OFF

GO
GRANT EXECUTE ON dbo.sp_ValidateAIGL TO Public
GO

View 2 Replies View Related

Macro

Jul 26, 2004

Our IT department says to me all a stored procedure is, is a Macro. This is what Our network tech says to me. There are days I just want slap these people. This is the same one that made the Flat File comment, I think databases are very important and can be very complex I get annoyed when they IT people make them seems as if they are of no importance at all.


Venting again sorry

View 9 Replies View Related

Macro

Sep 22, 2004

Has anyone ever tried to run a stored procedure through a macro before?? And If so do you get a message that says that the stored procedure exectuted successfully but a macro Halt macro message that says "Action Failed"?? Now the stored procedure executes just fine its just that the macro itself is having some trouble. Can anyone help me?? please

View 8 Replies View Related

DTS And Macro Excel

Jan 21, 2005

hi,

I have already set up a DTS package to convert my data to an excel file and I would like to alter the format of my data through my DTS without having to write a macro.

Do you know how to do this?

View 2 Replies View Related

Macro Dreamweaver 8

Apr 19, 2008

Hi,

I have Marco Dreamweaver 8 and SQL. I don't know how to tied them up. Anyone who can help me?

Thanks

View 12 Replies View Related

Running An Macro From DTS Package

May 21, 2002

Hi all,
I am trying to run a Excel macro from a DTS package.I've created the macro and Batch file to run a macro, and i am executing a batch file from DTS package.I am able to run a macro when i am executing a DTS package manually.but its not working when i schedule the process. any solutions?
its not the security problem also.I've checked it.

View 1 Replies View Related

Running An Excel Macro In DTS

Mar 16, 2002

Does anyone know how to do this?

View 1 Replies View Related

Excel Macro In Rdl File

Feb 29, 2008



Hi,

Is it possible to embed excel macros in an rdl report and run those macros while exporting the rdl report to excel.

Thanks,
Priya

View 3 Replies View Related

Calling An Excel Macro Of A DTS Package

Nov 30, 2000

Can you call run an excel macro as part dts step. I would imagine it would be some active script, but am not sure.
Any Ideas ?.

I am running SQL 7.0 sp2, excel 97.

View 1 Replies View Related

Execute Macro Code In ActiveX

Apr 17, 2008

Hi All

I just have a excel macro code, It is working in excel itself.
But I want to execute within SSIL package.

When I am trying through Active X, It is returning error.

Can any one help me please....



MichaelRaj Arokiyasamy

View 3 Replies View Related

Running SQL Server Job In An Excel Macro

Apr 19, 2007

I know this might be the wrong forums, but I thought that some SQL Server users might know the answer and have accomplished this before. Does anyone know how to run a SQL Server job through an Excel macro? I have the macro where it's entering the data into my database, but now I need to use the data by running the job. Thanks!

View 3 Replies View Related

Trigger On An Access Database?

Nov 11, 2006

We have an Access database with Access front-end to Access back-end.Another company has installed a separate application using SQLServer.At present certain information in the first application is enteredmanually into the second. We wish to automate this process.The other company is proposing that the SQLServer application sets up atrigger on a selected table in the Access backend. When a new recordis added, information can be transferred to the SQLServer.I am interested to know if this is really possible. I have found inBOL that the Access database can be set up as a linked server toSQLServer. Is this way to handle this and is it then possible to setup a trigger?I am not the person who will be doing this but would like to know if itpossible and, in general, how it is done.Jim

View 4 Replies View Related

After Execute Remove Macro From SSIS Package

Apr 18, 2008

Hi all

I am running a excel macro from SSIS package, after executing macro I just want to remove the module(Macro code) from Excel file.

can you please tell me how it?

MichaelRaj Arokiyasamy

View 1 Replies View Related

How To Create Table Names By Using Macro Variable? Thanks!

Oct 21, 2005

Greetings!I am now doing one type of analysis every month, and wanted to creattable names in a more efficient way.Here is what happens now, everytime I do the analysis, I will create atable called something like customer_20050930, and then update thetable by using several update steps. Then next month I will create atable called customer_20051031. Does anyone know if there is a betterway to do it? like using a macro variable for the month-end date? Noweverytime I have to change the table name in every single update step,which would cause errors if I forget to change one of them. By using amacro, I would only need to change it once.Thanks!

View 8 Replies View Related

Querying SQL Express Database From Excel Macro

Apr 28, 2006

How do I query an SQL Express database from within an Excel 2002 VBA macro?

For example, how could I accomplish this in an Excel macro.

SELECT myID FROM MyTable WHERE Compound = string in cell A1

And then put the resulting ID number in cell A2. The relationship between Compound and myID is always one to one.

Thanks to all.

Dan

View 1 Replies View Related

How Do I Run A Macro In Visual Studio Or Business Intelligence??

Oct 8, 2007



Hi Guys
I create some reports by connecting the SQL database using Business Intelligence.
I do these reports each fortnight so I want to automate these tasks using a macro.
How do I create or record a macro in BI??

I will need to have input parameters in it as well

When I click 'Tools' menu, I cant see any 'macro' submenu in it.

Please help guys

I am using SQL Server 2005

Thanks

View 5 Replies View Related

Trigger With Access To Remote Server

Jan 6, 2007

Hello,

i have two server connected to internet S1 and S2 (connection between both is only internet too).

I need write trigger on S1 which send update or another command to S2. Is it possible, and how (without using .NET methods only by using Transact SQL)?

Thnx, jakub.

View 6 Replies View Related

SQL Server 2008 :: Query Results Output Into CSV File To Use In VBA Macro

Jul 31, 2015

I have the following code below where I need to have all of the query results output into a .csv file to use in a VBA macro. The issue I am running into is that the data is not deliminating correctly and my rows are being shifted incorrectly. Any better way of out putting the results into a .csv file with a common delimiter.

-- Declare the variables
DECLARE @CMD VARCHAR(4000),
@DelCMD VARCHAR(4000),
@HEADERCMD VARCHAR(4000),
@Combine VARCHAR(4000),
@Path VARCHAR(4000),
@COLUMNS VARCHAR(4000)

[Code] ...

Output from query (please post in a text editor. The line starting with (only ) should be on line 1 after 20 pks and is shifted to a new line.):

557898^1^9885E25^80082^9.0 CM GLASS FIBER PADS 20PKS
(only 12 pks in stock that will ship today)
^12.00000000^.00000000^18.32000000^219.84000000000^28.30000000
^339.60000000000^9.98000000^35.2650176678445^DR9146322^0^

[Code] ....

View 1 Replies View Related

Include Macro Code From Reporting Service When Exporting To Excel

Mar 19, 2008

To overcome the inability to manage the sheet tab names when exporting from Reporting Services to Excel, is there anyway to include a short macro with the exported Excel workbook to Auto_Run macro when the Excel file is opened to rename the tabs?

View 1 Replies View Related

Power Point :: Macro Enabled PowerPivot Data Model

Aug 31, 2015

When we deploy any PowerPivot Data Model to SharePoint 2013, we get the following options-

1. Create New PowerPivot Report
2. Create New PowerView Report
3. Schedule Data Refresh

These options work fine as long as we deploy a normal Excel Data Model file like .xlsx . However, When I deploy Data Model with some VBA code (Macros, VB functions) contained within it i.e. Macro Enabled file - .xlsm,the above options didn't work. I got following error while creating a New PowerView report as  It says that your Excel has unsupported features like Macro function.Can't we create a new PowerPivot/PowerView report with Macro Enabled Data Model? Is this not supported in SharePoint 2013?

View 3 Replies View Related

Server Trigger Timing Out Access Append Query

Oct 17, 2013

I have a SQL Server database running on a local PC which will eventually be scaled up once everything is working.

The Database takes data from an Access database, then the SQL Server aggregates this data into several other tables.

I have used a trigger to run this in SQL Server, once a table in SQL Server is appended with a specific value.

I have tested the trigger to do a simple task, and this works.

I have tested the aggregation query which create 18 seperate tables as well. It takes around 25 minutes to run. These are huge tables

When I use Access to append the final value to start the SQL Server trigger it freezes and eventually times out. I assume this is because it is running the 25minute trigger, and Access has to wait until this is completed before it can proceed.

I was hoping it would trigger SQL Server to run the trigger, then Access could go off and do something else!

View 10 Replies View Related

Can't Access Inserted Table From Trigger; Msg 4104 The Multi-part Identifier ... Could Not Be Bound.

Sep 27, 2006

I'm a newbie have trouble using the "inserted" table in a trigger. When I run these SQL statements:CREATE DATABASE foobarGOUSE foobar GOCREATE TABLE foo ( fooID int IDENTITY (1, 1) NOT NULL, lastUpdated datetime, lastValue int, PRIMARY KEY(fooID))GOCREATE TABLE bar ( barID int IDENTITY (1, 1) NOT NULL, fooID int NOT NULL, [value] int NOT NULL, updated datetime NOT NULL DEFAULT (getdate()), primary key(barID), foreign key(fooID) references foo (fooID))GOCREATE TRIGGER onInsertBarUpdateFoo ON Bar FOR INSERTAS UPDATE Foo SET lastUpdated = inserted.updated, lastValue = inserted.[Value] WHERE foo.fooID = inserted.fooIDGO

I get the error message:

Msg 4104, Level 16, State 1, Procedure onInsertBarUpdateFoo, Line 4
The multi-part identifier "inserted.fooID" could not be bound.

I can get the trigger to work fine as long as I don't reference "inserted".

What am I missing?

I'm using Microsoft SQL Server Management Studio Express 9.00.2047.00 and SQL Express 9.0.1399

Thanks in advance for your help...
Larry

View 7 Replies View Related

Only One SSIS Job Runs...

Feb 12, 2007

Hi,

Currently I have two SSIS jobs on my machine. The problem I'm having is, only one of the jobs executes succesfully, the other one fails for incorrect user login. Both jobs use the same configuration database and all the packages on both jobs have the protection level set to "DontSaveSensitive". Both jobs have been deployed in the exact same manner, yet only one succeceeds and the other fails.

Can anybody tell me why this is going on?

View 2 Replies View Related

Vbs Script Runs As Standalone, But Not In Dts Or Sql Job

Jun 19, 2001

I have a vbs script to try to prove that I can perform vbs scripting in either a job step or a dts package
The script is

dim rs, sql,adoconn, adocommand, dataconnstring

set adoconn = createObject("ADODB.CONNECTION")
Set rs = CreateObject("ADODB.Recordset")
set adocommand = CreateObject("ADODB.Command")
adoconn.ConnectionString = "Provider=SQLOLEDB;Server=myserver;Database=pubs;U id=myuser;Pwd=mypass;"

adoconn.Open
sql = "select * from import"
rs.Open sql, adoconn,adOpenForwardOnly
while rs.EOF = false
sql = "insert into zz default values"
adocommand.ActiveConnection = adoconn
adocommand.CommandText = sql
adocommand.Execute

rs.MoveNext
wend

rs.Close
adoconn.Close
set adoconn = nothing


However,
when I run this from windows explorer it works fine,
but when I try to run it as an activeX script, I get the error ActiveX scripting: Function not found

As a cmdexec step in a job, I use the line c:inetpubwwwrootvbsvbstest1.vbs
It failed with the error
The process could not be created for step 1 of job 0x119BDBD264AD9B4597A9302786F0E250 (reason: %1 is not a valid Win32 application). The step failed.


What is wrong with the vbs script ?, or do I need to invoke it a different way ?

thanks in advance

View 1 Replies View Related

Can I Create A Job That Runs Other Jobs, Or.....

Aug 15, 2000

I have jobs (DTS packages) for several different tasks that I would like to run sequentially, rather than trying to estimate how long each will take and schedule them individually.

Any suggestions?

Thanks,
Cara

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved