S
stuart62
Hi,
I am retrieving data from AS/400 database to a worksheet
using QueryTable and I have the following problem.
My code is as follows:
'*********************************************
strConn = "ODBC;DRIVER={Client Access ODBC Driver (32-
bit)};SYSTEM=BBIS01;DBQ=QGPL " & _
"AULT1F2000;DFTPKGLIB=QGPL;LANGUAGEID=ENU;PKG=QGPL/
DEFAULT(IBM)" & _
",2,0,1,0,512; TRANSLATE=1;SIGNON=1;UID=myUID;"
strSQL = "SELECT COUNT(*) FROM SLP05"
Sheets(2).Activate
Set oQT = ActiveSheet.QueryTables.Add( _
Connection:=strConn, _
Destination:=Range("A1"), _
Sql:=strSQL)
oQT.Refresh
'*********************************************
However, the program got failed at the line ".Refresh" and
the error message is:
" Run-time error '1004':
General ODBC error "
Anyone knows how to solve this problem?
thanks a lot.
Stuart
I am retrieving data from AS/400 database to a worksheet
using QueryTable and I have the following problem.
My code is as follows:
'*********************************************
strConn = "ODBC;DRIVER={Client Access ODBC Driver (32-
bit)};SYSTEM=BBIS01;DBQ=QGPL " & _
"AULT1F2000;DFTPKGLIB=QGPL;LANGUAGEID=ENU;PKG=QGPL/
DEFAULT(IBM)" & _
",2,0,1,0,512; TRANSLATE=1;SIGNON=1;UID=myUID;"
strSQL = "SELECT COUNT(*) FROM SLP05"
Sheets(2).Activate
Set oQT = ActiveSheet.QueryTables.Add( _
Connection:=strConn, _
Destination:=Range("A1"), _
Sql:=strSQL)
oQT.Refresh
'*********************************************
However, the program got failed at the line ".Refresh" and
the error message is:
" Run-time error '1004':
General ODBC error "
Anyone knows how to solve this problem?
thanks a lot.
Stuart