Results 1 to 5 of 5
  1. #1
    VAer's Avatar
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163

    Runtime Error 3001: Invalid Argument

    Anyone knows how to fix the query syntax?

    Thanks.

    [/CODE]
    Code:
    SybaseConnString = "Driver={Adaptive Server Enterprise};app=myAppName;server=myServerAddress;port=myPortnumber;db=myDataBase;uid=myUsername;pwd=myPassword;"
    
    SyQuery = "SELECT * INTO AccessTableName FROM [" & SybaseConnString & "].[SybaseTableName]"
    
    DoCmd.RunSQL SyQuery
    



  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The connection is not part of the SQL.
    select field from table

    Your SQL makes no sense. Is it a select query,or append query?

  3. #3
    VAer's Avatar
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163
    Quote Originally Posted by ranman256 View Post
    The connection is not part of the SQL.
    select field from table

    Your SQL makes no sense. Is it a select query,or append query?
    But I have to identify connection string somewhere, otherwise how it can know where to copy data from. Sybase is considered as external database, in this case.

    Select Table, not select query.

    Copy Sybase Table data into Access Table. I want VBA code only, not through menu bar ODBC button.

    Thanks.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    SELECT INTO syntax will create a new table. If you want to add records to existing table use INSERT INTO SELECT syntax.

    Is table really named AccessTableName?

    Perhaps use TransferDatabase https://bytes.com/topic/access/answe...-automatically
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    VAer's Avatar
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163
    Quote Originally Posted by June7 View Post
    SELECT INTO syntax will create a new table. If you want to add records to existing table use INSERT INTO SELECT syntax.

    Is table really named AccessTableName?

    Perhaps use TransferDatabase https://bytes.com/topic/access/answe...-automatically
    No, it is substituted with AccessTableName when posting he question. In real code, I use the real table name.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-09-2017, 05:22 AM
  2. Runtime error 3001?
    By cloudforgiven in forum Access
    Replies: 22
    Last Post: 09-23-2016, 05:21 PM
  3. Vb-access runtime error 3001
    By bobykuriakose12 in forum Access
    Replies: 8
    Last Post: 06-12-2013, 11:33 AM
  4. Replies: 8
    Last Post: 06-18-2012, 03:49 PM
  5. Invalid Argument Error
    By koper in forum Access
    Replies: 2
    Last Post: 06-14-2010, 11:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums