ODBC, adLongVarChar not returning
Hi,
I'm trying to use VBA with the Remedy ODBC driver to download some
data. Most of it works fine until I get to a field of type
adLongVarChar. I use the GetChunk method to return data from it
(since the value propery is always null), but this returns empty most
of the time and only occasionally returns the correct data.
Would anyone here be able to help me?
My code is below.
Thanks,
---------------
Function get_adLongVarChar(sql As String, Conn As ADODB.Connection) As
String
On Error Resume Next
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
RS.Open sql, Conn
get_adLongVarChar = RS(0)
RS.Close
Set RS = Nothing
End Function
Sub test()
Dim sql As String
Dim v0
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.Open "DSN=RemedyODBC"
sql = "SELECT " & _
" problem_details " & _
" FROM Global_Problem_Management " & _
" WHERE ticket_id='123456'" & _
" ORDER BY Create_Date DESC" '
v0 = get_adLongVarChar(sql, Conn)
MsgBox v0
Conn.Close
Set Conn = Nothing
End Sub
Hi,
I'm trying to use VBA with the Remedy ODBC driver to download some
data. Most of it works fine until I get to a field of type
adLongVarChar. I use the GetChunk method to return data from it
(since the value propery is always null), but this returns empty most
of the time and only occasionally returns the correct data.
Would anyone here be able to help me?
My code is below.
Thanks,
---------------
Function get_adLongVarChar(sql As String, Conn As ADODB.Connection) As
String
On Error Resume Next
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
RS.Open sql, Conn
get_adLongVarChar = RS(0)
RS.Close
Set RS = Nothing
End Function
Sub test()
Dim sql As String
Dim v0
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.Open "DSN=RemedyODBC"
sql = "SELECT " & _
" problem_details " & _
" FROM Global_Problem_Management " & _
" WHERE ticket_id='123456'" & _
" ORDER BY Create_Date DESC" '
v0 = get_adLongVarChar(sql, Conn)
MsgBox v0
Conn.Close
Set Conn = Nothing
End Sub