Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Sep 2001
    Location
    Stuck at work..., Missouri, USA
    Posts
    248
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying to create a passthrough query via code, and am getting an error with the connection string.

    Code:
    Sub SQLPassThru()
    	Dim dbs As Database, qdf As QueryDef
    	Dim strConnect As String, rst As Recordset
    	Dim strSQL As String
    	
    	Set dbs = CurrentDb
    	strConnect = "Driver={Oracle ODBC Driver};" & _
    		   "Dbq=Database.WORLD;" & _
    		   "Uid=<My ID>;" & _
    		   "Pwd=<My PW>;"
    
    	Set qdf = dbs.CreateQueryDef("PassThru Name")
    	
    	qdf.Connect = strConnect
    When it hits the last line, I get error 3305 : Invalid connection string in pass-through query.

    What a I missing?
    <font face="Comic Sans MS">Morgan Erickson</font face=comic>
    morgan.erickson@sprint.com
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18>-From <img src=/S/flags/Colorado.gif border=0 alt=Colorado width=30 height=18> but living in <img src=/S/flags/Missouri.gif border=0 alt=Missouri width=30 height=18>...and working in Kansas.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    A suggestion - create a File or System ODBC Connection using the Data Sources ODBC tool, and then look at the Connection String it creates. I suspect there are some missing parameters. Is there an issue with using a fixed connection rather than using a DNS-less connection? Another tool you might find useful for this sort of thing is MZ-Tools - it has a utility that will build a connection string for you. Unfortunately I don't work with Oracle, so I can't be much help with the details.
    Wendell

Posting Permissions

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