Results 1 to 3 of 3

Thread: My Syntax is Suffering

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    Being a slow-witted newbie, I have been painfully attempting to string together my first app, and thanks especially to the ubiquitous Preeti and the web-based tutorials of Dale Shaw and Karl Moore it has been coming along nicely. However, I have some problems with syntax and I am pretty clueless. I think I'm at the point where I know what I'm doing and I just don't know exactly how to express it. If anybody could tell me what's wrong with the following code, I'd appreciate it.

    TIA,
    Jonathan

    SQL$ = "SELECT * FROM " & strTable
    SQL$ = SQL$ & " WHERE " & strFindBy
    SQL$ = SQL$ & " = " & strMatchWith
    SearchSQL = SQL$
    Dim db As Database
    Set db = OpenDatabase(There is a database directory here, but for company security reasons I can't post it)
    Set Adodc1.Recordset = db.OpenRecordset(SearchSQL)
    MSHFlexGrid1.Visible = True
    End Sub

    ------------------
    "Black?"
    "For over thirty years."

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    What is the value for strMatchWith ??? According to naming convention - its a string....then you're missing single quotes:

    SQL$ = "SELECT * FROM " & strTable
    SQL$ = SQL$ & " WHERE " & strFindBy
    SQL$ = SQL$ & " = '" & strMatchWith & "'"
    SearchSQL = SQL$


    Reagrds,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]



  3. #3

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    33

    Post

    Thank you, Serge. The SQL is not giving me trouble anymore. As for the ADO control... rrrrrrr.

    Thanks,
    Jonathan

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