Getvalue Error

Dim con As New ODBCConnectionDim qry As New ODBCQuery

Dim result As New ODBCResultSet

Set qry.Connection = con

Set result.Query = qry

con.ConnectTo(“DELLAS”)

qry.SQL = “SELECT * FROM [LISTINO LAME]”

Result.CacheLimit =“10000”

Result.Execute

If result.IsResultSetAvailable Then

result.NextRow

While Not (result.IsENDOfData)

Dim Doc As New NotesDocument(db)

doc.form = “F001”

For i = 1 To result.NumColumns

Select Case i

Case 1

  1. cat =result.GetValue(result.FieldName(i),cat)

or alternative row script

2)doc.cat =result.GetValue(i)

Why the row number 1) or 2) go to error and the message is:

Cannot convert data from native to expected or requested datatype (DBstsCNVR)

P.s: the Database is MS SQL .

I can try the script with Access Database and it is ok

The data of the table is string

bye bye J.Z

Subject: getvalue Error

The SQL in Access is slightly different from ANSI SQL. I think the first thing you want to do is to make sure your SQL select works correctly in SQLServer outside of Notes/Domino.

Subject: RE: getvalue Error

I found the error.

The data type was “nvarchar” that indefinite type.

Ms SQL want VARCHAR OR LONGCHAR and not “nvarchar”

THANK YOU!!

Subject: RE: getvalue Error

Did you ever get this resolved?

I am trying to get data from SQL2000 on W2000 server and am getting the same error message.

My code works on Access, and AS400, but not on SQL2000.

Thanks.