2147217865 Error Message Attempting to Populate a RecordSet from a DB2 Database
- From: "Tal" <jburke521@xxxxxxxxx>
- Date: 29 Dec 2006 09:44:54 -0800
I'm attempting to populate a recordset from a DB2 instance. I
establish the connection with the database using a DSN as follows (I've
replaced the DSN Name, username, and password with placeholders. Rest
assured the appropriate data is in my actual code and this portion does
work):
Dim db as ADODB.Connection
Dim rs as ADODB.RecordSet
Private Sub openDB()
Set db = New ADODB.Connection
db.CursorLocation = adUseServer
dbstr = "Provider=ibmdadb2; DSN=<DSNName>; UID=<username>;
PWD=<password>"
db.Open dbstr
End Sub
I then later attempt to build a recordset based on this connection in
another function as shown below:
Private Function getSequence(strWRK_CDE As String, strSEQ_TYP As
String) As String
Dim querySQL As String
querySQL = "select CURRENT_NO from ICNSEQUENCES where WRK_CDE = " &
strWRK_CDE & " and SEQ_TYPE = " & strSEQ_TYP
Set rs = New ADODB.Recordset
rs.Open querySQL, db
getSequence = rs!CURRENT_NO
When the code executes this line:
rs.Open querySQL, db
The error message occurs, as follows:
Run-time error '-2147217865 (80040e37)':
[DB2/6000] SQL0204N "FNDBUSER.ICNSEQUENCES" is an undefined name.
SQLSTATE=42704
I do have a problem with properly understanding inheritance so it could
be a problem with the way I've scoped the variables. Please verify.
Any help would be greatly appreciated.
Joshua
.
- Follow-Ups:
- Prev by Date: Re: Display ADO Recordset in Access
- Next by Date: Re: 2147217865 Error Message Attempting to Populate a RecordSet from a DB2 Database
- Previous by thread: Using a Like Statement where data can be either numeric or character.
- Next by thread: Re: 2147217865 Error Message Attempting to Populate a RecordSet from a DB2 Database
- Index(es):
Relevant Pages
|
|