Results 1 to 2 of 2

Thread: dBase SQL

  1. #1

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334
    I am (forced to) use a dBase IV database an am having real difficulty getting a certain SQL string to work. The code fot the bit I am using is:

    Code:
    Private Sub cmdExcep_Click()
        Dim sLike$
        
        Set rsMain = Nothing
        sLike = "*TEST*"
        With dlgOutput.List1
            .AddItem "TEST1"
            sSQL = "SELECT * FROM " & sFileN & " WHERE " & sFileN & "![ERROR] LIKE '" & sLike & "'" ' sFileN is the .dbf filename eg alpha.dbf
            Set rsMain = dbMain.OpenRecordset(sSQL)
        End With
    
    End Sub
    at runtime I get a runtime error 3075 - syntax error.

    HELP!!

  2. #2

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334

    My own reply

    Oh and if the code is changed to read

    Code:
    Private Sub cmdExcep_Click()
        Dim sLike$
        
        Set rsMain = Nothing
        sLike = "*BLOCK*"
        With dlgOutput.List1
            .AddItem "ACCOUNT BLOCKED"
            sSQL = "SELECT * FROM " & sFileN & " WHERE ![ERROR] LIKE '" & sLike & "'"
            Set rsMain = dbMain.OpenRecordset(sSQL)
        End With
    
    End Sub
    I get the 3061 error - to few parameters: expected 1
    Matt G
    VS6 Ent SP5 @ Work
    VS6 Ent SP5 & VB.Net @ Home
    [email protected]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width