• PassThrough query troubles

    Author
    Topic
    #458396

    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=;" & _
    		   "Pwd=;"
    
    	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?

    Viewing 0 reply threads
    Author
    Replies
    • #1152600

      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.

    Viewing 0 reply threads
    Reply To: PassThrough query troubles

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: