VB5/ADO/SQL 6.5 currency field update fails? 
Author Message
 VB5/ADO/SQL 6.5 currency field update fails?

I have set up a test table in SQL 6.5 consisting of an integer field
(keyField) and a money field (currencyField). When I try to update the
currency field I get this error: [ODBC Server Driver] Invalid character
value for cast specification. The test code looks like this:

Private Sub cmdWrite_Click()

    Dim rstTest As New ADODB.Recordset
    Dim strSQL As String
    Dim strWhere As String

    strSQL = "SELECT keyField, currencyField FROM dbo.tblTest  WHERE "

    If flgNew Then
        strWhere = "0 =1"
    Else
        strWhere = "keyField = " & lngKey
    End If

     rstTest.Open strSQL & strWhere, mcnSetDb, adOpenForwardOnly,
adLockOptimistic, adCmdText

    With rstTest
        If flgNew Then .AddNew
        .Fields("keyField") = lngKey
        .Fields("currencyField") = curCurrencyField
        .Update
        .Close
    End With

End Sub

If I use some other field type for the second field, everything works fine
with the same code.

Any ideas?????  Thanks.

Barry Fitzgerald





Mon, 23 Oct 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB5: Updating recordset on MS SQL-Server 6.5

2. ADO / SQL 6.5 / Text Fields

3. Space in Field Name,SQL 6.5 ADO

4. ADO, SQL 6.5 and VarChar Fields

5. Max number of fields in an ADO/Sql 6.5 query

6. ADO 1.5 - VB5.0 - SQL Server 6.5

7. VB5, ADO 1.5, SQL Server 6.5 problem

8. VB5 / ADO 1.5 / SQL Server 6.5

9. VB5, ADO 1.5, SQL Server 6.5 problem

10. Send Update Statement to SQl 6.5

11. Error doing update with VB 3.0 and SQL Server 6.5

12. ERwin 2.5 Cascading Deletes/Updates with MS SQL 6.5

 

 
Powered by phpBB® Forum Software