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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Provider problem

Status
Not open for further replies.

martynh

Technical User
Oct 17, 2001
73
GB
I've been testing the IBM OLE Provider for DB2 (on Win2K). I'm getting an error from the Command object, which can be demonstrated with the vbscript that follows. Could someone else try the script and tell me if they get an error when getting the value for 'IsLong Minimum Length'. This is the 33rd property of the command object. The counter (i) starts at 30, so you can see what should happen. (Although this seems an obscure error, I think it's causing me problems with what I'm really trying to do.)

Thanks

Martyn


Code:
option explicit
dim cn, cmd, i, e

set cn = createObject("ADODB.Connection")

cn.provider = "IBMDADB2"
cn.Properties("User ID").Value = "???"
cn.Properties("Password").Value = "???"
cn.Properties("Data Source").Value = "databasename"

cn.open

set cmd = createObject("ADODB.Command")
cmd.ActiveConnection = cn

on error resume next
i = 30
do while i < cmd.properties.count
   
   wscript.echo cmd.properties(i).name & &quot;, &quot; & cmd.properties(i).value
   if err then
      for each e in cn.errors  
         wscript.echo &quot;Error getting value for &quot; & _
                  cmd.properties(i).name & vblf & vblf & _
                 &quot;Error Details: &quot; & vblf & _
                 &quot;Number: &quot; & e.number & vblf & _
                 &quot;Desc: &quot; & e.description & vblf & _
                 &quot;Source: &quot; & e.Source & vblf & _
                 &quot;NativeError: &quot; & e.NativeError & vblf & _
                 &quot;SQLState: &quot; & e.SQLState
      next 
      wscript.quit(1)
   end if
   i = i + 1
loop

cn.close
set cn = nothing

wscript.echo &quot;OK&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top