Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC, adLongVarChar not returning

Status
Not open for further replies.

bakelita

Programmer
Feb 24, 2003
2
ES
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top