Results 1 to 4 of 4

Thread: SQL won't run

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34
    Access 2000
    This code snippet:

    Dim strSQL1 As String
    strSQL1 = "SELECT ips FROM MainData WHERE (cnum ='123456');"
    DoCmd.RunSQL (strSQL1)

    Returns the error:
    "A RunSQL action requires an argument consisting of an SQL ststement"

    What's up?

  2. #2
    Guest
    from the access help files:



    DoCmd.RunSQL "UPDATE Employees " & _
    "SET Employees.Title = 'Regional Sales Manager' " & _
    "WHERE Employees.Title = 'Sales Manager';"

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34
    DoCmd.RunSQL "SELECT ips FROM MainData WHERE (cnum='123456');"

    returns the same error.

    I'm going to scream! It just won't query the database!

  4. #4
    Lively Member
    Join Date
    Feb 1999
    Location
    Austin,TX,USA
    Posts
    98

    Hey Larryn!

    Hey Larryn! I can't FIND the Openrecordset Method/Action in Access2000 help for ADO! What's the ADO equivalent for DAO's OpenRecordset?? My code is:

    Dim MSA2K As Access.Application
    Set MSA2K = New Access.Application
    MSA2K.OpenCurrentDatabase "C:\Test.mdb"
    MSA2K.DoCmd.RunSQL=("SELECT * FROM TestResults WHERE TestNumber = 2")
    I get the SAME error! Is there a workaround for this?




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