Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1201
  • Last Modified:

VBScript (in qtp), IE:6, Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another

I am running vbscript in qtp.  When it comes to creating the recordset it throws an error.  I have taken the querry and executed it in winsql, successfully returning results.  I have also trimmed down the sql statement to simply be select a.* from db2sza4.MID_CPOB_TRNS_STG a (I still recieve the same error).
' ADO State Types
Const adStateClosed = 0
Const adStateOpen = 1
 
' ADO Cursor Locations
Const adUseServer = 2
Const adUseClient = 3
 
' ADO Cursor Types
Const adOpenForwardOnly = 0 
Const adOpenKeyset = 1
Const adOpenDynamic = 2 
Const adOpenStatic = 3 
 
' ADO Lock Types
Const adLockReadOnldeleteRow = 1
Const adLockPessimistic = 2 
Const adLockOptimistic = 3 
Const adLockBatchOptimistic = 4 
 
Const ADS_SCOPE_SUBTREE = 2
 
Dim conDB2
Dim strUserId                  ' User ID
Dim strPswd                    ' Password
 
Set objExcel = CreateObject("Excel.Application")
Set conDB2 = CreateObject("ADODB.Connection")
Set rsRawCompare= CreateObject("ADODB.Recordset")
 
' Set object Default settings.
conDB2.CursorLocation = adUseClient
 
strUserID = **
strPswd = ***
 
conDB2.Open "Provider=IBMDADB2;DSN=" & strDSN & ";DBNAME=" & strDB & ";User ID=" & strUserID & ";Password=" & strPswd & ";"
'THIS IS WHERE THE ERROR OCCURRS
rsRawCompare.Open "Select a.BU_RAW_TRNS_ID A, b.BU_RAW_TRNS_ID B, a.ADMN_TRNS_ID C, b.ADMN_TRNS_ID D, a.EVNT_TYP_LBL_CD E, b.EVNT_TYP_LBL_CD F, a.INV_ID G, b.INV_ID H, a.BAS_CTGRY_LBL_CD I, b.BAS_CTGRY_LBL_CD J, a.BAS_TYP_LBL_CD K, b.BAS_TYP_LBL_CD L, a.BAS_AMT M, b.BAS_AMT N, a.ADMN_TRNS_EFCTV_DT O, b.ADMN_TRNS_EFCTV_DT P, a.ADMN_PRCS_DT Q, b.ADMN_PRCS_DT R, a.CMP_POB_PRCS_DT S, b.ADMN_TRNS_PRCS_DT T, a.BLD_TS U, a.CHG_BY_ID V, a.TRNS_SRCE_LBL_CD W, b.TRNS_SRCE_LBL_CD X, a.SUB_ORG_LBL_CD Y, b.SUB_ORG_LBL_CD Z,a.ADMN_POB_ID AA, b.ADMN_POB_ID AB, a.CMP_POB_ID AC, c.CMP_POB_ID AD from db2sza4.MID_CPOB_TRNS_STG a, db2sza4.MID_ADMN_TRNS_STG b, db2sza4.MID_CMP_POB c where ((a.BU_RAW_TRNS_ID = b.BU_RAW_TRNS_ID) and    (a.ADMN_TRNS_ID = b.ADMN_TRNS_ID) and    (a.CMP_POB_ID = c.CMP_POB_ID)) order by a.BU_RAW_TRNS_ID", conDB2, adOpenStatic, adLockReadOnly
 
objExcel.Visible = True
objExcel.Workbooks.Add

Open in new window

0
Fuzzbumper
Asked:
Fuzzbumper
  • 2
1 Solution
 
BobTheViolentCommented:
If the error occurs where you said it does I would think it is a problem with the connection string not the actual SQL since you got query results manually in winsql anyway.

Go check out http://www.connectionstrings.com/ and see if it helps verify you have it formatted correctly.
0
 
FuzzbumperAuthor Commented:
You know, BobTheViolent.  Sometimes it just takes an extra set of eyes.  After messing with that sql statement forever, one of my properties was set incorrectly.  Thanks for the help.  
0
 
BobTheViolentCommented:
Glad that worked for you.  Very true about the second set of eyes comment.  Happens to me often!  :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now