adErrInvalidArgument driving me nuts! please advise 
Author Message
 adErrInvalidArgument driving me nuts! please advise

using mssql 6.5, vb6sp5
I am trying to use adodc1.recordset.find to point to a
specific record in a datagrid. the datagrid is populated
with all records from a table. I have a seperate adodc2
that uses a query to just get a specific record. I have
bound 2 text boxes to the adodc2 records and am using
these as criteria for my search. one field in the table is
a varchar and one is a date/time. when i use find for the
number "varchar colomn" it finds that record fine, but
when i try to search by date I get error 3001. I havent
got a type mismatch error unless i start converting stuff.
heres my find:
Adodc1.Recordset.Find "broadcast_date_time = " &
Textnowtime.Text,1


Tue, 30 Mar 2004 00:45:28 GMT
 adErrInvalidArgument driving me nuts! please advise

Check this out

Private Function PrepareTheFilter() As Boolean
On Error GoTo vbError

PrepareTheFilter = False

Dim i As Integer

For i = 0 To cboOperator.Count - 1
    If cboOperator(i).Text = "LIKE" Then
        txtValue(i).Text = txtValue(i).Text & "*"
    End If
Next i

For i = 0 To txtValue.Count - 1
    If txtValue(i) <> "" Then

        Dim enm As DataTypeEnum

        enm = gFieldsDataType(cboFields(i).Text)

        Select Case enm

        Case adChar, adBSTR, adWChar
            txtValue(i).Text = "'" & txtValue(i).Text & "*'"

        Case adDate, adDBDate
            txtValue(i).Text = "#" & txtValue(i).Text & "#"

        Case adBigInt, adCurrency, adDecimal, adDouble, _
             adInteger, adNumeric, adSingle, adTinyInt, _
             adUnsignedBigInt, adUnsignedInt, adUnsignedSmallInt, _
             adUnsignedTinyInt, adSmallInt, adBoolean

            ' do nothing, - stops access to Case Else below
        Case Else
            txtValue(i).Text = "'" & txtValue(i).Text & "'"

        End Select
    End If
Next i

For i = 0 To cboFields.Count - 1
    ' This sub/sub procedure places square brackets around
    ' a field name which contains a space between words
    ' eg Last Name  becomes  [Last Name]
    Dim sNullStr As String
    Dim sStr As String
    Dim sNewStr
    Dim n As Integer

    ' store the original value
    sStr = cboFields(i).Text
    ' define the empty space to be found
    sNullStr = " "

    n = InStr(sStr, sNullStr)

    If n > 0 Then
        sNewStr = "[" & sStr & "]"
        cboFields(i).Text = sNewStr
    End If
Next i

PrepareTheFilter = True
Exit Function
vbError:
fs.Error
End Function

Quote:

> using mssql 6.5, vb6sp5
> I am trying to use adodc1.recordset.find to point to a
> specific record in a datagrid. the datagrid is populated
> with all records from a table. I have a seperate adodc2
> that uses a query to just get a specific record. I have
> bound 2 text boxes to the adodc2 records and am using
> these as criteria for my search. one field in the table is
> a varchar and one is a date/time. when i use find for the
> number "varchar colomn" it finds that record fine, but
> when i try to search by date I get error 3001. I havent
> got a type mismatch error unless i start converting stuff.
> heres my find:
> Adodc1.Recordset.Find "broadcast_date_time = " &
> Textnowtime.Text,1



Wed, 31 Mar 2004 15:24:58 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Please Help, this is driving me nuts !!

2. This query is driving me nuts - please help !!

3. help vb & access2k is driving me nuts

4. SUB QUERY driving me NUTS!

5. Driving me nuts

6. BCP is driving me nuts.

7. DAO Issue -- Invalid Page Fault Driving Me Nuts!

8. Driving me nuts!!

9. JDBC Errors are driving me nuts!!!

10. msdn docs drive me nuts, help find CDaoTableDef connect string format description

11. I'm sure it something simple but it's driving me nuts :-(

12. HELP: isql is driving me nuts!


 
Powered by phpBB® Forum Software