Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS script - CreateObject fails

Status
Not open for further replies.

GlennBSI

Programmer
Mar 27, 2001
77
US
I am writing a VBScript transformation script (in a DTS package) that needs to create a connection object so that I can do transaction processing and do inserts to and gets from multiple tables for each Source record but I am having a problem I can't explain.

In the script, I am trying to do a CreateObject("ADODB.Connection"), but it fails with error 438 - object does not support this property or method. Actually, no matter what adodb object I try to create I get the same error. Code is like this:

Dim objConn
On Error Resume Next
Err.Clear 'CLEAR in case error already exists!

Set objConn = CreateObject("ADODB.Connection")
If Err.Number <> 0 Then
Msgbox &quot;error is &quot; & err.number & &quot; &quot; & err.description
End If

(The source of the error is VBScript Runtime) (important clue?)

This fails no matter if I do &quot;ADODB.Recordset&quot; or &quot;ADODB.Command&quot; too.

The WEIRD thing is that when I run a different script that my buddy wrote on the same machine that creates a recordset object, it doesn't fail.

Any suggestions would be greatly appreciated!!

Glenn
gclark@landam.com
 
It's always the stupid things that get you stumped, huh?

Well, my problem was that I was checking the error number after doing the createobject, EXCEPT I was doing
If Err.Num

instead of:
If Err.Number

So, nevermind!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top