R
Ron
I am trying to pull a record set from our financial software's database. I
only want GL accounts that are associated with a certain location. The GL
Accounts use the sturcture GLCODE-LOCATION. I am using the OLE DB driver to
access the data. Here is a snippet of my code
Const CONNECTION As String = "Provider=PervasiveOLEDB;Data
Source=DB;Location=SERVER;"
Dim CN As ADODB.connection
Dim rsQuery As ADODB.Recordset
Dim rsDetails As ADODB.Recordset
Dim qryDetails As String
'open a connection to the database
Set CN= New ADODB.connection
CN.Open CONNECTION
'Create Query to retrieve transaction details
qryDetails = "SELECT BATCHNBR, ENTRYNBR, ACCTID, TRANSNBR, FISCALPERD,
Sum(TRANSAMT) AS TRANSAMOUNT " & _
"FROM GLPJD " & _
"WHERE BATCHNBR >= '363361' " & _
"GROUP BY BATCHNBR, ENTRYNBR, ACCTID, TRANSNBR, FISCALPERD
" & _
"HAVING InStr(ACCTID, 'FR') <> 0 " & _
"ORDER BY BATCHNBR ASC;"
'"HAVING InStr(ACCTID, 'FR') <> 0 "
Set rsDetails = New ADODB.Recordset
Set rsDetails.ActiveConnection = CN
rsDetails.Source = qryDetails
rsDetails.LockType = adLockReadOnly
rsDetails.CursorType = adOpenKeyset
rsDetails.Open
I am unable to upen the recordset. I get the following error:
-2147467259 -->[LNA][ODBC Engine Interface] Error in expression:
InStr(ACCTID, 'FR').
I have also tried "HAVING CharIndex('FR', ACCTID) <> 0 " and that doesn't
work either. anyone have a solution to my error?
Thanks in advance.
only want GL accounts that are associated with a certain location. The GL
Accounts use the sturcture GLCODE-LOCATION. I am using the OLE DB driver to
access the data. Here is a snippet of my code
Const CONNECTION As String = "Provider=PervasiveOLEDB;Data
Source=DB;Location=SERVER;"
Dim CN As ADODB.connection
Dim rsQuery As ADODB.Recordset
Dim rsDetails As ADODB.Recordset
Dim qryDetails As String
'open a connection to the database
Set CN= New ADODB.connection
CN.Open CONNECTION
'Create Query to retrieve transaction details
qryDetails = "SELECT BATCHNBR, ENTRYNBR, ACCTID, TRANSNBR, FISCALPERD,
Sum(TRANSAMT) AS TRANSAMOUNT " & _
"FROM GLPJD " & _
"WHERE BATCHNBR >= '363361' " & _
"GROUP BY BATCHNBR, ENTRYNBR, ACCTID, TRANSNBR, FISCALPERD
" & _
"HAVING InStr(ACCTID, 'FR') <> 0 " & _
"ORDER BY BATCHNBR ASC;"
'"HAVING InStr(ACCTID, 'FR') <> 0 "
Set rsDetails = New ADODB.Recordset
Set rsDetails.ActiveConnection = CN
rsDetails.Source = qryDetails
rsDetails.LockType = adLockReadOnly
rsDetails.CursorType = adOpenKeyset
rsDetails.Open
I am unable to upen the recordset. I get the following error:
-2147467259 -->[LNA][ODBC Engine Interface] Error in expression:
InStr(ACCTID, 'FR').
I have also tried "HAVING CharIndex('FR', ACCTID) <> 0 " and that doesn't
work either. anyone have a solution to my error?
Thanks in advance.